UPS power check

General chat about HostMonitor
Post Reply
Mogge
Posts: 83
Joined: Thu Mar 04, 2004 3:38 pm
Location: Denmark

UPS power check

Post by Mogge »

Hi!

A little question...

How do I make a check on my APC Smart-UPS (connected to the server by a serial cable) if it´s on battery or on normal power?

It writes in the Event log but it´s only a "write when event happens" and then again "write when event happens". e.i. It can write a log entry somthing like "APC on battery" and then when power returns "APC on normal power".

I have tried with a NTLog scan but .... no....

Can anyone help me?

Kind regards
Mogge
timn
Posts: 184
Joined: Thu Nov 20, 2003 9:57 am
Location: United States

Post by timn »

Mogge

Can't tell you about the SmartUPS, however we have 3 APC Symmetra 16000s.

We monitor the Output Status OID from the Powernet MIB:

(1.3.6.1.4.1.318.1.1.1.4.1.1.0)

Return codes for output status are:

1 = Unknown
2 = On Line
3 = On Battery
4 = On Smart Boost
5 = Timed Sleeping
6 = Software Bypass
7 = Off
8 = Rebooting
9 = switched Bypass
10 = Hardware Failure Bypass
11 = Sleeping Until Power Return
12 = On Smart Trim
Mogge
Posts: 83
Joined: Thu Mar 04, 2004 3:38 pm
Location: Denmark

Post by Mogge »

Hi

Just to be on the safe side... The UPS are not connected to any network - only directly to a server thru a serial cable.

Is this still a surgestion then? If this should work I have to ask the server ...???

Regards
/Mogge
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Any software comes with UPS? Probably it provides some standard interface (e.g. SNMP)
Mogge
Posts: 83
Joined: Thu Mar 04, 2004 3:38 pm
Location: Denmark

Post by Mogge »

Sure, but it dosn't give any help on the SNMP part...

Just a normal monitoring / setup program.

Any idea on the NT Log part ?

It write in the NT log when it gets an event but it´s not easy to make a "On power / on batteri" of a NT log...

/Mogge
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I just compiled and uploaded simple utiltity that can check power status and return appropriate exit code.
www.ks-soft.net/download/powercheck.exe
Usage:> powercheck.exe [-ls | -bf | -bl]
Options:
-ls - Line Status. Utility will return EXITCODE with following meanings:
1 = ONLINE
2 = BACKUP POWER
0 = OFFLINE
255= Unknown
-bf - Battery Flag. Utility will return EXITCODE with following meanings:
1 = HIGH
2 = LOW
4 = CRITICAL
8 = CHARGING
9 = CHARGING. Level is HIGH
10 = CHARGING. Level is LOW
12 = CHARGING. Level is CRITICAL
128= NO BATTERY
255= Unknown
-bl - Battery Level. EXITCODE will represent battery level (%)
255= Uknown
If your UPS provides necessary information to Windows, you will be able to use External test method to perform check. Also you may use Shell Script test method but in this case you will need to write simple script (e.g. BAT file) to check exit codes.

Utility should work on Windows 98, ME, 2000, XP, 2003. It will not work on Windows NT
Utility checks power status on local system only. So, if you want to monitor remote system, install RMA and utility on that system.

Regards
Alex
Mogge
Posts: 83
Joined: Thu Mar 04, 2004 3:38 pm
Location: Denmark

Post by Mogge »

I don´t know what to say, Alex...

You amaze me again and again...
I just compiled and uploaded simple utiltity
This is simply fantastic...!

Now comes the time where I have to tell you that the APC Smart-UPS use their own software to control the UPS so actually your utility dosn't work. It will only work on a Windows controlled UPS.

I contacted the support at APC and got a long answer return telling me that I can connect to a WEB page on the Smart-UPS (actually the Agent installed on the server) even that the UPS is connected thru a serial cable. The web page give me the possibility to configure the UPS in details so a lot of good possibilities has been discovered. Now I have a oppotunity to let HM check the web page for the information - if it wasn't for the fact that the web page demands a username/password on a seperate page before displaying the desired page. Is there any way to get around this?

There is another way to get the alert. The UPS Agent can send a eMail to a mail account with an alert text. What about an eMail interface in HM? You know - HM reads the mails and then set/reset an alert according to the text in the mail? Maybe this could also be used to control some of the functionalities in HM...

Just a surgesstion.

Very kind regards
Mogens B. Lassen[/b]
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Now I have a oppotunity to let HM check the web page for the information - if it wasn't for the fact that the web page demands a username/password on a seperate page before displaying the desired page. Is there any way to get around this?
Probably its possible. You should check HTML code of the page (page that asks username and password). Page contains some form that sends GET or POST request to UPS's web server. Setup HTTP test using the same URL with your username and password as parameters.
E.g. URL may look like http://localhost/ups/upsstatistics.php? ... secretword
There is another way to get the alert. The UPS Agent can send a eMail to a mail account with an alert text. What about an eMail interface in HM? You know - HM reads the mails and then set/reset an alert according to the text in the mail? Maybe this could also be used to control some of the functionalities in HM...
Sorry, it will not work. HostMonitor can send mail but it does not retrieve any.

Regards
Alex
Post Reply