Xymon Mailing List Archive search

DOWNTIME for Non-Network tests

32 messages in this thread

list Thorsten Erdmann · Mon, 24 Aug 2009 15:32:33 +0200 ·
Hi,

can I somehow tell Hobbit to ignore bad test results in certain times, like the DOWNTIME tag does for network tests?
e.g. I do some Oracle database tests and shutdown the databases on weekends for backup. I don't want this planned downtime to appear in the Non-Green-Systems View and in the Availability reports.

Maybe I can "missuse" the badTEST tag somehow?

Thanks
Thorsten Erdmann


If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Rich Smrcina · Mon, 24 Aug 2009 08:39:11 -0500 ·
quoted from Thorsten Erdmann
user-9219fb9415b1@xymon.invalid wrote:
Hi,

can I somehow tell Hobbit to ignore bad test results in certain times, like the DOWNTIME tag does for network tests?
e.g. I do some Oracle database tests and shutdown the databases on weekends for backup. I don't want this planned downtime to appear in the Non-Green-Systems View and in the Availability reports.

Maybe I can "missuse" the badTEST tag somehow?

Thanks
Thorsten Erdmann

If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
If this is really planned and regularly scheduled, then use the DOWNTIME tag.  If it can be variable, you can schedule downtime in advance with the enable/disable menu item.

-- 
Rich Smrcina
Phone: XXX-XXX-XXXX
http://www.linkedin.com/in/richsmrcina

Catch the WAVV! http://www.wavv.org
WAVV 2010 - Apr 9-14, 2010 Covington, KY
list Thorsten Erdmann · Mon, 24 Aug 2009 16:06:54 +0200 ·
quoted from Rich Smrcina
can I somehow tell Hobbit to ignore bad test results in certain times, like the DOWNTIME tag does for network tests?
e.g. I do some Oracle database tests and shutdown the databases on weekends for backup. I don't want this planned downtime to appear in the Non-Green-Systems View and in the Availability reports.
Maybe I can "missuse" the badTEST tag somehow?> If this is really 
planned and regularly scheduled, then use the DOWNTIME 
tag.  If it can be variable, you can schedule downtime in advance with the enable/disable menu item.
It is really planned. But as I see it, the DOWNTIME tag is only valid for the network test. But the network is up during this period. So the system itself is green, but the oracle test is red and is so propagated to the summary pages above.

But I cannot really test it, because I cannot shutdown my databases at the current time. But we will see what happens tomorrow.

Thorsten
quoted from Rich Smrcina


If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Thorsten Erdmann · Wed, 02 Sep 2009 08:23:55 +0200 ·
I was able to test it now. Indeed the DOWNTIME tag has no effect to the database test. Do I have to interpret the DOWNTIME tag for myself or is there a possibility to "downtime" specific tests in hobbit itself.
quoted from Thorsten Erdmann
can I somehow tell Hobbit to ignore bad test results in certain 
times, 
like the DOWNTIME tag does for network tests?
e.g. I do some Oracle database tests and shutdown the databases on >> weekends for backup. I don't want this planned downtime to appear in >> the Non-Green-Systems View and in the Availability reports.
Maybe I can "missuse" the badTEST tag somehow?> If this is really planned and regularly scheduled, then use the DOWNTIME > tag.  If it can be variable, you can schedule downtime in advance with 
the enable/disable menu item.
It is really planned. But as I see it, the DOWNTIME tag is only valid for the network test. But the network is up during this period. So the system itself is green, but the oracle test is red and is so propagated to the summary pages above.

But I cannot really test it, because I cannot shutdown my databases at the current time. But we will see what happens tomorrow.

Thorsten


If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank
you for your cooperation. 
If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Dominique Frise · Wed, 02 Sep 2009 08:46:08 +0200 ·
DOWNTIME can be used for any test (local or network).
Here an example of setting for Oracle that we use:

DOWNTIME=orcl,orcl-chk,procs,msgs:*:0130:0230:Backups

"orcl" is a local check running on the client and "orcl-chk" is a remote 
check -connecting to the listener- performed from the server.

Dominique
quoted from Thorsten Erdmann

user-9219fb9415b1@xymon.invalid wrote:
I was able to test it now. Indeed the DOWNTIME tag has no effect to the 
database test. Do I have to interpret the DOWNTIME tag for myself or is 
there a possibility to "downtime" specific tests in hobbit itself.
can I somehow tell Hobbit to ignore bad test results in certain 
times,
like the DOWNTIME tag does for network tests?
e.g. I do some Oracle database tests and shutdown the databases on
weekends for backup. I don't want this planned downtime to appear in
the Non-Green-Systems View and in the Availability reports.
Maybe I can "missuse" the badTEST tag somehow?> If this is really
planned and regularly scheduled, then use the DOWNTIME
tag.  If it can be variable, you can schedule downtime in advance with
the enable/disable menu item.
It is really planned. But as I see it, the DOWNTIME tag is only
valid for the network test. But the network is up during this
period. So the system itself is green, but the oracle test is red
and is so propagated to the summary pages above.

But I cannot really test it, because I cannot shutdown my databases
at the current time. But we will see what happens tomorrow.

Thorsten


If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.
If you are not the intended addressee, please inform us immediately that 
you have received this e-mail in error, and delete it. We thank you for 
your cooperation.
list Thorsten Erdmann · Fri, 04 Sep 2009 11:17:40 +0200 ·
Hi

I have some difficulties to ignore some messages using the hobbit-client.cfg file.

I want to ignore all messages that contain the word "smb_proc_readdir_long".

So I build such rule:

HOST=s068a300
        LOG     %.* %(fatal|error)   COLOR=red IGNORE=smb_proc_readdir_long
        LOG     %.* warning          COLOR=yellow

I also tried IGNORE=%smb...

If I write a message to /var/log/user like this:

logger -p daemon.notice Testmessage ERROR smb_proc_readdir_long

the message is not ignored by Hobbit:

System logs at Fri Sep 4 11:08:39 CEST 2009

 Critical entries in /var/log/messages
 .2009/09/04 11:03:53][s068a300:daemon.notice] root: Testmessage ERROR smb_proc_readdir_long
 .2009/09/04 11:03:53][s068a300:daemon.notice] root: Testmessage ERROR smb_proc_readdir_long


Another question: if I have many IGNOREs, can I put them on multiple lines for readability like this:

HOST=s068a300
        LOG     %.* %(fatal|error)   COLOR=red          IGNORE=smb_proc_readdir_long
         IGNORE=blabla
         IGNORE=nonsense
        LOG     %.* warning          COLOR=yellow
quoted from Dominique Frise
 

 Thorsten Erdmann


If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Dominique Frise · Fri, 04 Sep 2009 12:16:20 +0200 ·
Give this a try:

HOST=s068a300
    LOG     %.* %(fatal|error) IGNORE=%(?-i)smb_proc_readdir_long

 From hobbit-client.cfg(5):
...
      Note that Xymon defaults  to  case-
      insensitive  pattern matching; if that is not what you want,
      put "(?-i)" between the "%" and the  regular  expression  to
      turn  this off. E.g. "%(?-i)HTTPD" will match the word HTTPD
      only when it is upper-case.
quoted from Thorsten Erdmann
...

Another question: if I have many IGNOREs, can I put them on multiple
lines for readability like this:
I don't think this is supported.
Rules are separated with | (pipe)

E.g.:  IGNORE=%(?-i)forceload|hypervisor\sLDC


BTW: hobbitd_client can be used for testing your rules:

[bb at iris bin]$ ./hobbitd_client --test
Hostname (.=end, ?=dump, !=reload) []: testhost
Hosttype []: linux
Test (cpu, mem, disk, proc, log, port): log
log filename: /var/log/messages
To read log data from a file, enter '@FILENAME' at the prompt
log line: Testmessage ERROR smb_proc_readdir_long
log line:
Log status is green

Hostname (.=end, ?=dump, !=reload) [testhost]:


Dominique
quoted from Thorsten Erdmann

user-9219fb9415b1@xymon.invalid wrote:
Hi

I have some difficulties to ignore some messages using the hobbit-client.cfg file.

I want to ignore all messages that contain the word "smb_proc_readdir_long".

So I build such rule:

HOST=s068a300
        LOG     %.* %(fatal|error)   COLOR=red   IGNORE=smb_proc_readdir_long
        LOG     %.* warning          COLOR=yellow

I also tried IGNORE=%smb...

If I write a message to /var/log/user like this:

logger -p daemon.notice Testmessage ERROR smb_proc_readdir_long

the message is not ignored by Hobbit:

System logs at Fri Sep 4 11:08:39 CEST 2009

 Critical entries in /var/log/messages
 .2009/09/04 11:03:53][s068a300:daemon.notice] root: Testmessage ERROR smb_proc_readdir_long
 .2009/09/04 11:03:53][s068a300:daemon.notice] root: Testmessage ERROR smb_proc_readdir_long


Another question: if I have many IGNOREs, can I put them on multiple lines for readability like this:

HOST=s068a300
        LOG     %.* %(fatal|error)   COLOR=red           IGNORE=smb_proc_readdir_long
         IGNORE=blabla
         IGNORE=nonsense
        LOG     %.* warning          COLOR=yellow
 

 Thorsten Erdmann

If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Alan Sparks · Fri, 04 Sep 2009 10:29:32 -0600 ·
quoted from Dominique Frise
user-9219fb9415b1@xymon.invalid wrote:
Hi

I have some difficulties to ignore some messages using the
hobbit-client.cfg file.

I want to ignore all messages that contain the word
"smb_proc_readdir_long".

So I build such rule:

HOST=s068a300
        LOG     %.* %(fatal|error)   COLOR=red  
IGNORE=smb_proc_readdir_long
        LOG     %.* warning          COLOR=yellow

I also tried IGNORE=%smb...

If I write a message to /var/log/user like this:

logger -p daemon.notice Testmessage ERROR smb_proc_readdir_long

the message is not ignored by Hobbit:

System logs at Fri Sep 4 11:08:39 CEST 2009

 Critical entries in /var/log/messages
 .2009/09/04 11:03:53][s068a300:daemon.notice] root: Testmessage ERROR
smb_proc_readdir_long
 .2009/09/04 11:03:53][s068a300:daemon.notice] root: Testmessage ERROR
smb_proc_readdir_long


Another question: if I have many IGNOREs, can I put them on multiple
lines for readability like this:

HOST=s068a300
        LOG     %.* %(fatal|error)   COLOR=red  
         IGNORE=smb_proc_readdir_long
         IGNORE=blabla
         IGNORE=nonsense
        LOG     %.* warning          COLOR=yellow
 

Thorsten Erdmann

If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.
It's not obvious to me why it is not working.  You might try to work
around the issue but using the "ignore" pattern in the client-local.cfg
configuration for the host or class, and not doing it in the
hobbit-clients config.

For the second, I do not believe multiple IGNORE keywords are accepted. 
You can use a pattern match for this, like:
IGNORE=%(this thing|that thing)
Or, I think multiple "ignore" patterns (lines) /is/ allowed for a log
entry in client-local.

HTH.
-Alan
list Thorsten Erdmann · Wed, 09 Sep 2009 15:18:57 +0200 ·
Hi

I often see that the CONN test fails for one minute (which is my polling interval) on many machines. If I run a normal ping command I also sometimes see a single lost packet. It seems that this is the normal behaviour on our location? Would you see that as normal, too? And how can I configure hobbit(ping) for some fault tolerance. E.g. only report a failure if mor than 3 subsequent pings fail. I need that on a global location so adding a badconn tag to all hosts is not what I want.

I use hobbit 4.2.0

Thorsten Erdmann


Wed Sep 9 13:10:05 2009 conn NOT ok 
Service conn on m068t5063 is not OK : Host does not respond to ping


System unreachable for 1 poll periods (0 seconds)

 53.42.122.50 is unreachable
quoted from Alan Sparks


If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Thorsten Erdmann · Wed, 09 Sep 2009 15:23:32 +0200 ·
HOST=s068a300
    LOG     %.* %(fatal|error) IGNORE=%(?-i)smb_proc_readdir_long
This also does not work.
But that seems clear to me. I would switch case _in_sensitivity off, so it would be case sensitive, that is more likely to fail.

Thorsten
quoted from Alan Sparks
 From hobbit-client.cfg(5):
...
      Note that Xymon defaults  to  case-
      insensitive  pattern matching; if that is not what you want,
      put "(?-i)" between the "%" and the  regular  expression  to
      turn  this off. E.g. "%(?-i)HTTPD" will match the word HTTPD
      only when it is upper-case.
...

Another question: if I have many IGNOREs, can I put them on multiple
lines for readability like this:
I don't think this is supported.
Rules are separated with | (pipe)

E.g.:  IGNORE=%(?-i)forceload|hypervisor\sLDC


BTW: hobbitd_client can be used for testing your rules:

[bb at iris bin]$ ./hobbitd_client --test
Hostname (.=end, ?=dump, !=reload) []: testhost
Hosttype []: linux
Test (cpu, mem, disk, proc, log, port): log
log filename: /var/log/messages
To read log data from a file, enter '@FILENAME' at the prompt
log line: Testmessage ERROR smb_proc_readdir_long
log line:
Log status is green

Hostname (.=end, ?=dump, !=reload) [testhost]:


Dominique

user-9219fb9415b1@xymon.invalid wrote:
Hi
I have some difficulties to ignore some messages using the > hobbit-client.cfg file.
I want to ignore all messages that contain the word 
"smb_proc_readdir_long".
So I build such rule:
HOST=s068a300
        LOG     %.* %(fatal|error)   COLOR=red > IGNORE=smb_proc_readdir_long
        LOG     %.* warning          COLOR=yellow
I also tried IGNORE=%smb...
If I write a message to /var/log/user like this:
logger -p daemon.notice Testmessage ERROR smb_proc_readdir_long
the message is not ignored by Hobbit:
System logs at Fri Sep 4 11:08:39 CEST 2009
 Critical entries in /var/log/messages
 .2009/09/04 11:03:53][s068a300:daemon.notice] root: Testmessage ERROR 
smb_proc_readdir_long
 .2009/09/04 11:03:53][s068a300:daemon.notice] root: Testmessage ERROR 
smb_proc_readdir_long
Another question: if I have many IGNOREs, can I put them on multiple > lines for readability like this:
HOST=s068a300
        LOG     %.* %(fatal|error)   COLOR=red >          IGNORE=smb_proc_readdir_long
         IGNORE=blabla
         IGNORE=nonsense
        LOG     %.* warning          COLOR=yellow
Thorsten Erdmann
If you are not the intended addressee, please inform us immediately 
that 
you have received this e-mail in error, and delete it. We thank you 
for 
your cooperation.
If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Larry Barber · Wed, 9 Sep 2009 08:25:53 -0500 ·
See the "badconn" tag in the bb-hosts man page.

Thanks,
Larry Barber

On 9/9/09, user-9219fb9415b1@xymon.invalid <user-9219fb9415b1@xymon.invalid>
quoted from Thorsten Erdmann
wrote:

Hi

I often see that the CONN test fails for one minute (which is my polling
interval) on many machines. If I run a normal ping command I also sometimes
see a single lost packet. It seems that this is the normal behaviour on our
location? Would you see that as normal, too? And how can I configure
hobbit(ping) for some fault tolerance. E.g. only report a failure if mor
than 3 subsequent pings fail. I need that on a global location so adding a
badconn tag to all hosts is not what I want.

I use hobbit 4.2.0

Thorsten Erdmann


Wed Sep 9 13:10:05 2009 conn NOT ok

Service conn on m068t5063 is not OK : Host does not respond to ping


System unreachable for 1 poll periods (0 seconds)

 53.42.122.50 is unreachable

If you are not the intended addressee, please inform us immediately that
you have received this e-mail in error, and delete it. We thank you for your
cooperation.
list Thorsten Erdmann · Wed, 09 Sep 2009 15:35:55 +0200 ·
See the "badconn" tag in the bb-hosts man page.
As I said, I don't want to add that badconn tag to every host. Is there a way to set that globally for all hosts?

Thorsten
quoted from Larry Barber

Thanks,
Larry Barber
On 9/9/09, user-9219fb9415b1@xymon.invalid <user-9219fb9415b1@xymon.invalid> 
wrote:

Hi

I often see that the CONN test fails for one minute (which is my polling interval) on many machines. If I run a normal ping command I
also sometimes see a single lost packet. It seems that this is the normal behaviour on our location? Would you see that as normal, too?
And how can I configure hobbit(ping) for some fault tolerance. E.g. only report a failure if mor than 3 subsequent pings fail. I need that on a global location so adding a badconn tag to all hosts is not what I want.

I use hobbit 4.2.0

Thorsten Erdmann


Wed Sep 9 13:10:05 2009 conn NOT ok 
Service conn on m068t5063 is not OK : Host does not respond to ping


System unreachable for 1 poll periods (0 seconds)

 53.42.122.50 is unreachable

If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank
you for your cooperation. 
If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Thorsten Erdmann · Wed, 09 Sep 2009 16:22:54 +0200 ·
Hi,

sorry if this a little offtopic, but maybe someone has a devmon template 
for the following UPS:

Emerson/Liebert HiPulse MM
MGE Galaxy Single
MGE Upsilon STS_100 Cross switch
MGE Upsilon STS_20 Cross switch

Thank you
quoted from Thorsten Erdmann
Thorsten


If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list David Baldwin · Thu, 10 Sep 2009 09:52:44 +1000 ·
quoted from Thorsten Erdmann
user-9219fb9415b1@xymon.invalid wrote:
Hi,

sorry if this a little offtopic, but maybe someone has a devmon
template for the following UPS:

Emerson/Liebert HiPulse MM
MGE Galaxy Single
MGE Upsilon STS_100 Cross switch
MGE Upsilon STS_20 Cross switch

Thank you
Thorsten


If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.
I have a template for the standard UPS MIB which I could send through. I
have a little more work to do on it splitting the power status into 3
tests for input, output and battery. Should give me motivation to
complete this today and I will upload to devmon SF site.

You can check if your UPS supports the standard UPS MIB or wants a
proprietary one (substituting for myups below, and your community string
if it is not "public"):

snmpwalk -v2c -cpublic myups 1.3.6.1.2.1.33.1.1

Note that some UPS devices only support SNMPv1, so try -v1 instead of
-v2c above if it doesn't work.

David.

-- 
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617


Keep up to date with what's happening in Australian sport visit http://www.ausport.gov.au

This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.
list Craig Boyce · Thu, 10 Sep 2009 12:48:20 +1200 ·
 Hi Thorsten,

I have a template I created for the Liebert Nx range of UPS's.
I can't guarantee it will work with the HiPulse but it could be a
starting point for you.

I'll look at uploading it to the SF repository.

Craig
quoted from David Baldwin

-----Original Message-----
From: David Baldwin [mailto:user-cbbf693f2c89@xymon.invalid] 
Sent: Thursday, 10 September 2009 11:53 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] UPS monitoring using devmon

user-9219fb9415b1@xymon.invalid wrote:
Hi,

sorry if this a little offtopic, but maybe someone has a devmon
template for the following UPS:

Emerson/Liebert HiPulse MM
MGE Galaxy Single
MGE Upsilon STS_100 Cross switch
MGE Upsilon STS_20 Cross switch

Thank you
Thorsten


If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.
I have a template for the standard UPS MIB which I could send through. I
have a little more work to do on it splitting the power status into 3
tests for input, output and battery. Should give me motivation to
complete this today and I will upload to devmon SF site.

You can check if your UPS supports the standard UPS MIB or wants a
proprietary one (substituting for myups below, and your community string
if it is not "public"):

snmpwalk -v2c -cpublic myups 1.3.6.1.2.1.33.1.1

Note that some UPS devices only support SNMPv1, so try -v1 instead of
-v2c above if it doesn't work.

David.

-- 
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617


Keep up to date with what's happening in Australian sport visit
http://www.ausport.gov.au

This message is intended for the addressee named and may contain
confidential and privileged information. If you are not the intended
recipient please note that any form of distribution, copying or use of
this communication or the information in it is strictly prohibited and
may be unlawful. If you receive this message in error, please delete it
and notify the sender.


DISCLAIMER:
 

The information contained in this email message is confidential and for the attention of the intended recipient only. 
It is not necessarily the official view or communication of the Rodney District Council. 
If you are not the intended recipient you must not disclose, copy or distribute this message or the information in it. 
If you have received this message in error, please delete or destroy all copies of the email and notify the sender immediately. 
Rodney District Council  accepts no responsibility for any effects this email message or attachments has on the recipient network or computer system.
list Thorsten Erdmann · Thu, 10 Sep 2009 08:17:45 +0200 ·
Hi Craig,
hi David,

sounds very nice.

I tried that snmpwalk. It only works with snmp V1. This is the output:

SNMPv2-SMI::mib-2.33.1.1.1.0 = STRING: "MGE UPS SYSTEMS"
SNMPv2-SMI::mib-2.33.1.1.2.0 = STRING: "Galaxy PW Single//"
SNMPv2-SMI::mib-2.33.1.1.3.0 = ""
SNMPv2-SMI::mib-2.33.1.1.4.0 = STRING: "GB (SN 49EE49044)"
SNMPv2-SMI::mib-2.33.1.1.5.0 = ""
SNMPv2-SMI::mib-2.33.1.1.6.0 = ""

As I see it, this is only the description of the UPS. I will look for the MIB of my devices.
Don't know where all the other things which I want to monitor at minimum are located in the MIB like:

Overall status or am I runnung on battery
output power
remaining battery time
temperature
I'll look at uploading it to the SF repository.
Maybe this is a stupid question, but I don't find templates and things on the SF page. Only devmon itself.
I look at http://devmon.sourceforge.net/ and at http://sourceforge.net/projects/devmon/
There is a devmon-template file there, but as I see it, it contains only the templates which are delivered with devmon itself.

It would be nice if you share your templates. You can also contact me via user-674624a37c09@xymon.invalid at daimler dot com

Thank you very much

Thorsten
quoted from Craig Boyce

Craig

-----Original Message-----
From: David Baldwin [mailto:user-cbbf693f2c89@xymon.invalid] Sent: Thursday, 10 September 2009 11:53 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] UPS monitoring using devmon

user-9219fb9415b1@xymon.invalid wrote:
Hi,

sorry if this a little offtopic, but maybe someone has a devmon
template for the following UPS:

Emerson/Liebert HiPulse MM
MGE Galaxy Single
MGE Upsilon STS_100 Cross switch
MGE Upsilon STS_20 Cross switch

Thank you
Thorsten


If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.
I have a template for the standard UPS MIB which I could send through. I
have a little more work to do on it splitting the power status into 3
tests for input, output and battery. Should give me motivation to
complete this today and I will upload to devmon SF site.

You can check if your UPS supports the standard UPS MIB or wants a
proprietary one (substituting for myups below, and your community string
if it is not "public"):

snmpwalk -v2c -cpublic myups 1.3.6.1.2.1.33.1.1

Note that some UPS devices only support SNMPv1, so try -v1 instead of
-v2c above if it doesn't work.

David.

-- 
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617


Keep up to date with what's happening in Australian sport visit
http://www.ausport.gov.au

This message is intended for the addressee named and may contain
confidential and privileged information. If you are not the intended
recipient please note that any form of distribution, copying or use of
this communication or the information in it is strictly prohibited and
may be unlawful. If you receive this message in error, please delete it
and notify the sender.


DISCLAIMER:


The information contained in this email message is confidential and for the attention of the intended recipient only. It is not necessarily the official view or communication of the Rodney District Council. If you are not the intended recipient you must not disclose, copy or
distribute this message or the information in it. If you have received this message in error, please delete or destroy
all copies of the email and notify the sender immediately. Rodney District Council  accepts no responsibility for any effects this email message or attachments has on the recipient network or computer system.

If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Vernon Everett · Thu, 10 Sep 2009 14:50:08 +0800 ·
I wrote this a while back for our MGEs.
As you can see, it predates my introduction to devmon and indicates a complete lack of understanding of SNMP.
That being said, the code and the MIBs might give you a good indication of where to start.
(Either that, or you can just use it as "good enough")
This was designed to run on the hobbit/xymon server.

I have been meaning to rewrite this, or move it to devmon, but just haven't had the time.
(And it's doing an adequate job for now.)

Cheers
      V

bb-host entries look like this
1.2.3.4     galaxy3000    # http://1.2.3.4/ups_prop.htm ups galaxy3000 COMMENT:"Meaningful Comment if required"
2.3.4.5   Karratha_UPS    # http://2.3.4.5/ups_prop.htm ups galaxy3000 COMMENT:"Insert Comment"


--- snip---

cat ups.ksh
#!/bin/ksh
DATE=$(date)
#set -x
SPACER="                                                                            "
BBTMP=/tmp
#BBHOSTS=/etc/hobbit/bb-hosts
#OUT=$BBTMP/upspage
BBHOSTLIST="$BBHOSTS $(grep ^include $BBHOSTS | awk '{ print $2 }')" # Make sure we read the include files too
#grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include"
grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include" | while read IP UPSNAME HASH URL UPS TYPE OTHER
do
   echo $IP $UPSNAME
   ping -c1 $IP > /dev/null
   if [ $? -eq 0 ]
   then
      COLOUR=green
      case $TYPE in
         galaxy3000)
$OUT.warn
$OUT.tmp
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-SMI::mib-2.33.1.1.1.0)
            DEVICE=${TEMP##*:}       # String
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-SMI::mib-2.33.1.1.2.0)
            MODEL=${TEMP##*:}        # String
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-MIB::sysLocation.0)
            LOCATION=${TEMP##*:}             # String
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-SMI::mib-2.33.1.1.4.0)
            SERIAL=${TEMP##*:}               # String
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.4.8.0)
            LOWBATTERY=${TEMP##*:}           # Integer % Point at which shutdown triggered
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.1.0)
            TIME_REMAIN=${TEMP##*:}     # Integer seconds
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.2.0)
            BATTERY_LEVEL=${TEMP##*:}   # Integer %
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.9.0)
            BATTERY_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.11.0)
            BATTERY_REPLACE=${TEMP##*:} # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.15.0)
            CHARGER_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.3.0)
            OUT_ON_BAT=${TEMP##*:}      # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.4.0)
            OUT_ON_BYPASS=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.10.0)
            OUT_OVERLOAD=${TEMP##*:}    # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.10.0)
            COMMSOK=${TEMP##*:}         # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.1.0)
            INPHASES=${TEMP##*:}        # Integer 1 or 3

            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.2.1.2)
            INVOLT=${TEMP##*:}          # Integer 10ths of a volt

            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.2.1.3)
            INFREQ=${TEMP##*:}          # Integer 10ths of a Hertz

            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.2.1.6)
            INAMPS=${TEMP##*:}          # Integer 10ths of an Amp

            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.3.0)
            INOK=${TEMP##*:}            # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.4.0)
            INFAILCAUSE=${TEMP##*:}     # Integer 1=no fault
                                     #         2=bad voltage
                                     #         3=bad frequency
                                     #         4=no voltage
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.1.0)
            OUTPHASES=${TEMP##*:}       # Integer 1 or 3
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.2)
            OUTVOLT=${TEMP##*:}         # Integer 10ths of a volt
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.3)
            OUTFREQ=${TEMP##*:}         # Integer 10ths of a Hertz
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.4)
            OUTLOAD=${TEMP##*:}         # Integer %
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.5)
            OUTAMPS=${TEMP##*:}         # Integer 10ths of an Amp
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.11.0)
            OVERTEMP=${TEMP##*:}        # Integer 1=yes 2=no
            echo "Manufacturer                          "$DEVICE | sed 's/"//g' >> $OUT.tmp
            echo "Model                                "$MODEL | sed 's/"//g' >> $OUT.tmp
            echo "Serial Number                        "$SERIAL | sed 's/"//g' >> $OUT.tmp
            echo "Location                             "$LOCATION | sed 's/"//g' >> $OUT.tmp
            echo >> $OUT.tmp
            #$LOWBATTERY
            #WARN=""
            #[ -z "$TIME_REMAIN" ] && TIME_REMAIN=0
            #[ $TIME_REMAIN -lt 1200 -a "$COLOUR" != "red" ] && COLOUR=yellow
            #[ $TIME_REMAIN -lt 1200 ] && WARN="Time Remaining low"
            #[ $TIME_REMAIN -lt 600 ] && COLOUR=red
            #[ $TIME_REMAIN -lt 600 ] && WARN="Time Remaining critical"
            #[ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            ((s=$TIME_REMAIN%60))
            ((m=$TIME_REMAIN/60))
            echo "Time Remaining                        "$m Minutes $s Seconds >> $OUT.tmp
            WARN=""
            [ -z "$BATTERY_LEVEL" ] && BATTERY_LEVEL=0
            [ $BATTERY_LEVEL -lt 95 -a "$COLOUR" != "red" ] && COLOUR=yellow
            [ $BATTERY_LEVEL -lt 95 ] && WARN="Battery level low"
            [ $BATTERY_LEVEL -lt 50 ] && COLOUR=red
            [ $BATTERY_LEVEL -lt 50 ] && WARN="Battery level critical"
            [ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            echo "Battery Level                        "$BATTERY_LEVEL % >> $OUT.tmp
            BATTERY_LEVEL=$(echo $BATTERY_LEVEL | sed 's/[ \t]*//')
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BF=Yes
               COLOUR=red
               echo "Battery Fault!" >> $OUT.warn
            else
               BF=No
            fi
            echo "Battery Fault                         "$BF >> $OUT.tmp
            if [ $BATTERY_REPLACE -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            echo "Replace Battery                       "$BR >> $OUT.tmp
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            if [ $CHARGER_FAULT -eq 1 ]
            then
               CF=Yes
               COLOUR=red
               echo "Charger Fault" >> $OUT.warn
            else
               CF=No
            fi
            echo "Charger Fault                         "$CF >> $OUT.tmp
            if [ $OUT_ON_BAT -eq 1 ]
            then
               OUT_ON_BAT=Yes
               COLOUR=red
               echo "UPS running on battery" >> $OUT.warn
            else
               OUT_ON_BAT=No
            fi
            echo "On Battery                            "$OUT_ON_BAT >> $OUT.tmp
            if [ $OUT_ON_BYPASS -eq 1 ]
            then
               OUT_ON_BYPASS=Yes
               COLOUR=red
               echo "UPS on power bypass" >> $OUT.warn
            else
               OUT_ON_BYPASS=No
            fi
            echo "On Bypass                             "$OUT_ON_BYPASS >> $OUT.tmp
            if [ $OUT_OVERLOAD -eq 1 ]
            then
               OUT_OVERLOAD=Yes
               COLOUR=red
               echo "UPS output overload" >> $OUT.warn
            else
               OUT_OVERLOAD=No
            fi
            echo "Battery Overload                      "$OUT_OVERLOAD >> $OUT.tmp
            if [ $OVERTEMP -eq 1 ]
            then
               OVERTEMP=Yes
               COLOUR=red
               echo "Unit overheating" >> $OUT.warn
            else
               OVERTEMP=No
            fi
            echo "Unit Overheating                      "$OVERTEMP >> $OUT.tmp
            #if [ $COMMSOK -eq 2 ]
            #then
            #   COMMSOK=No
            #   COLOUR=red
            #   echo "No comms from device" >> $OUT.warn
            #else
            #   COMMSOK=Yes
            #fi
            #echo "Comms OK                              "$COMMSOK >> $OUT.tmp
            echo >> $OUT.tmp
            echo "Input Phases                         "$INPHASES >> $OUT.tmp
            INVOLT=$(echo "scale=1 ; $INVOLT/10" | bc)
            echo "Input Voltage                         "$INVOLT >> $OUT.tmp
            INFREQ=$(echo "scale=1 ; $INFREQ/10" | bc)
            echo "Input Frequency                       "$INFREQ >> $OUT.tmp
            INAMPS=$(echo "scale=1 ; $INAMPS/10" | bc)
            echo "Input Current                         "$INAMPS >> $OUT.tmp
            if [ $INOK -eq 1 ]
            then
               # A silly case of reverse logic applies here
               INOK=No
               COLOUR=red
               echo "Power input outside tollerance" >> $OUT.warn
            else
               INOK=Yes
            fi
            echo "Input OK                              "$INOK >> $OUT.tmp
            [ $INFAILCAUSE -eq 1 ] && FAILCAUSE="No failures"
            [ $INFAILCAUSE -eq 2 ] && FAILCAUSE="Voltage out of tollearance"
            [ $INFAILCAUSE -eq 3 ] && FAILCAUSE="Frequency out of tollernace"
            [ $INFAILCAUSE -eq 4 ] && FAILCAUSE="No voltage - power fail"
            echo "Cause of Failure                      "$FAILCAUSE >> $OUT.tmp
            echo >> $OUT.tmp
            echo "Output Phases                        "$OUTPHASES >> $OUT.tmp
            OUTVOLT=$(echo "scale=1 ; $OUTVOLT/10" | bc)
            echo "Output Voltage                        "$OUTVOLT >> $OUT.tmp
            OUTFREQ=$(echo "scale=1 ; $OUTFREQ/10" | bc)
            echo "Output Frequency                      "$OUTFREQ >> $OUT.tmp
            OUTAMPS=$(echo "scale=1 ; $OUTAMPS/10" | bc)
            echo "Output Current                        "$OUTAMPS >> $OUT.tmp
            OUTLOAD=$(echo $OUTLOAD | sed 's/[ \t]*//')
            echo "Output Load                           "$OUTLOAD % >> $OUT.tmp
            echo >> $OUT.final
            cat $OUT.warn >> $OUT.final
            cat $OUT.tmp >> $OUT.final
            echo '<FONT COLOR="Black">' >> $OUT.final
            echo "Load=$OUTLOAD" >> $OUT.final
            echo "Charge=$BATTERY_LEVEL" >> $OUT.final
            echo '</FONT>' >> $OUT.final
            rm $OUT.tmp
            rm $OUT.warn
       esac
    else
       echo "Device Unreachable!" >> $OUT.final
       #COLOUR=yellow
    fi
    $BB $BBDISP "status $UPSNAME.ups $COLOUR $DATE $(cat $OUT.final)"
    rm $OUT.final
done

--- snip ---
quoted from Thorsten Erdmann


From: user-9219fb9415b1@xymon.invalid [mailto:user-9219fb9415b1@xymon.invalid]
Sent: Thursday, 10 September 2009 2:18 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Antwort: RE: [hobbit] UPS monitoring using devmon


Hi Craig,
hi David,

sounds very nice.

I tried that snmpwalk. It only works with snmp V1. This is the output:

SNMPv2-SMI::mib-2.33.1.1.1.0 = STRING: "MGE UPS SYSTEMS"
SNMPv2-SMI::mib-2.33.1.1.2.0 = STRING: "Galaxy PW Single//"
SNMPv2-SMI::mib-2.33.1.1.3.0 = ""
SNMPv2-SMI::mib-2.33.1.1.4.0 = STRING: "GB (SN 49EE49044)"
SNMPv2-SMI::mib-2.33.1.1.5.0 = ""
SNMPv2-SMI::mib-2.33.1.1.6.0 = ""

As I see it, this is only the description of the UPS. I will look for the MIB of my devices.
Don't know where all the other things which I want to monitor at minimum are located in the MIB like:

Overall status or am I runnung on battery
output power
remaining battery time
temperature
I'll look at uploading it to the SF repository.
Maybe this is a stupid question, but I don't find templates and things on the SF page. Only devmon itself.
I look at http://devmon.sourceforge.net/ and at http://sourceforge.net/projects/devmon/
There is a devmon-template file there, but as I see it, it contains only the templates which are delivered with devmon itself.

It would be nice if you share your templates. You can also contact me via user-674624a37c09@xymon.invalid at daimler dot com

Thank you very much

Thorsten

Craig

-----Original Message-----
From: David Baldwin [mailto:user-cbbf693f2c89@xymon.invalid]
Sent: Thursday, 10 September 2009 11:53 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] UPS monitoring using devmon

user-9219fb9415b1@xymon.invalid wrote:
Hi,

sorry if this a little offtopic, but maybe someone has a devmon
template for the following UPS:

Emerson/Liebert HiPulse MM
MGE Galaxy Single
MGE Upsilon STS_100 Cross switch
MGE Upsilon STS_20 Cross switch

Thank you
Thorsten


If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.
I have a template for the standard UPS MIB which I could send through. I
have a little more work to do on it splitting the power status into 3
tests for input, output and battery. Should give me motivation to
complete this today and I will upload to devmon SF site.

You can check if your UPS supports the standard UPS MIB or wants a
proprietary one (substituting for myups below, and your community string
if it is not "public"):

snmpwalk -v2c -cpublic myups 1.3.6.1.2.1.33.1.1

Note that some UPS devices only support SNMPv1, so try -v1 instead of
-v2c above if it doesn't work.

David.

--
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617


Keep up to date with what's happening in Australian sport visit
http://www.ausport.gov.au

This message is intended for the addressee named and may contain
confidential and privileged information. If you are not the intended
recipient please note that any form of distribution, copying or use of
this communication or the information in it is strictly prohibited and
may be unlawful. If you receive this message in error, please delete it
and notify the sender.


DISCLAIMER:


The information contained in this email message is confidential and
for the attention of the intended recipient only.
It is not necessarily the official view or communication of the
Rodney District Council.
If you are not the intended recipient you must not disclose, copy or
distribute this message or the information in it.
If you have received this message in error, please delete or destroy
all copies of the email and notify the sender immediately.
Rodney District Council  accepts no responsibility for any effects
this email message or attachments has on the recipient network or
computer system.

If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.


NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.
list Vernon Everett · Thu, 10 Sep 2009 15:40:21 +0800 ·
Oops, forgot to add the graphing bit.

Usual stuff.
In hobbitserver.cfg
Add "ups=ncv" to TEST2RRD=
Add "ups" to GRAPHS=
Add line NCV_ups="Load:GAUGE,Charge:GAUGE"

Add this to hobbitgraph.cfg
[ups]
        TITLE UPS Charge
        YAXIS Power
        -u 100
        -l 0
        DEF:u=ups.rrd:Charge:AVERAGE
        DEF:p=ups.rrd:Load:AVERAGE
        LINE2:u#00CC00:Charge
        LINE2:p#0000FF:Load
        COMMENT:\n
        GPRINT:u:LAST:Charge   \: %5.1lf%s (cur)
        GPRINT:u:MAX: \: %5.1lf%s (max)
        GPRINT:u:MIN: \: %5.1lf%s (min)
        GPRINT:u:AVERAGE: \: %5.1lf%s (avg)\n
        GPRINT:p:LAST:Load   \: %5.1lf%s (cur)
        GPRINT:p:MAX: \: %5.1lf%s (max)
        GPRINT:p:MIN: \: %5.1lf%s (min)
        GPRINT:p:AVERAGE: \: %5.1lf%s (avg)\n
Cheers
     Vernon
quoted from Vernon Everett


From: Everett, Vernon [mailto:user-9da1a1882f49@xymon.invalid]
Sent: Thursday, 10 September 2009 2:50 PM
To: 'user-ae9b8668bcde@xymon.invalid'
Subject: RE: [hobbit] Antwort: RE: [hobbit] UPS monitoring using devmon

I wrote this a while back for our MGEs.
As you can see, it predates my introduction to devmon and indicates a complete lack of understanding of SNMP.
That being said, the code and the MIBs might give you a good indication of where to start.
(Either that, or you can just use it as "good enough")
This was designed to run on the hobbit/xymon server.

I have been meaning to rewrite this, or move it to devmon, but just haven't had the time.
(And it's doing an adequate job for now.)

Cheers
      V

bb-host entries look like this
1.2.3.4     galaxy3000    # http://1.2.3.4/ups_prop.htm ups galaxy3000 COMMENT:"Meaningful Comment if required"
2.3.4.5   Karratha_UPS    # http://2.3.4.5/ups_prop.htm ups galaxy3000 COMMENT:"Insert Comment"


--- snip---

cat ups.ksh
#!/bin/ksh
DATE=$(date)
#set -x
SPACER="                                                                            "
BBTMP=/tmp
#BBHOSTS=/etc/hobbit/bb-hosts
#OUT=$BBTMP/upspage
BBHOSTLIST="$BBHOSTS $(grep ^include $BBHOSTS | awk '{ print $2 }')" # Make sure we read the include files too
#grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include"
grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include" | while read IP UPSNAME HASH URL UPS TYPE OTHER
do
   echo $IP $UPSNAME
   ping -c1 $IP > /dev/null
   if [ $? -eq 0 ]
   then
      COLOUR=green
      case $TYPE in
         galaxy3000)
$OUT.warn
$OUT.tmp
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-SMI::mib-2.33.1.1.1.0)
            DEVICE=${TEMP##*:}       # String
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-SMI::mib-2.33.1.1.2.0)
            MODEL=${TEMP##*:}        # String
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-MIB::sysLocation.0)
            LOCATION=${TEMP##*:}             # String
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-SMI::mib-2.33.1.1.4.0)
            SERIAL=${TEMP##*:}               # String
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.4.8.0)
            LOWBATTERY=${TEMP##*:}           # Integer % Point at which shutdown triggered
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.1.0)
            TIME_REMAIN=${TEMP##*:}     # Integer seconds
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.2.0)
            BATTERY_LEVEL=${TEMP##*:}   # Integer %
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.9.0)
            BATTERY_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.11.0)
            BATTERY_REPLACE=${TEMP##*:} # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.15.0)
            CHARGER_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.3.0)
            OUT_ON_BAT=${TEMP##*:}      # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.4.0)
            OUT_ON_BYPASS=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.10.0)
            OUT_OVERLOAD=${TEMP##*:}    # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.10.0)
            COMMSOK=${TEMP##*:}         # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.1.0)
            INPHASES=${TEMP##*:}        # Integer 1 or 3

            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.2.1.2)
            INVOLT=${TEMP##*:}          # Integer 10ths of a volt

            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.2.1.3)
            INFREQ=${TEMP##*:}          # Integer 10ths of a Hertz

            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.2.1.6)
            INAMPS=${TEMP##*:}          # Integer 10ths of an Amp

            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.3.0)
            INOK=${TEMP##*:}            # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.4.0)
            INFAILCAUSE=${TEMP##*:}     # Integer 1=no fault
                                     #         2=bad voltage
                                     #         3=bad frequency
                                     #         4=no voltage
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.1.0)
            OUTPHASES=${TEMP##*:}       # Integer 1 or 3
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.2)
            OUTVOLT=${TEMP##*:}         # Integer 10ths of a volt
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.3)
            OUTFREQ=${TEMP##*:}         # Integer 10ths of a Hertz
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.4)
            OUTLOAD=${TEMP##*:}         # Integer %
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.5)
            OUTAMPS=${TEMP##*:}         # Integer 10ths of an Amp
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.11.0)
            OVERTEMP=${TEMP##*:}        # Integer 1=yes 2=no
            echo "Manufacturer                          "$DEVICE | sed 's/"//g' >> $OUT.tmp
            echo "Model                                "$MODEL | sed 's/"//g' >> $OUT.tmp
            echo "Serial Number                        "$SERIAL | sed 's/"//g' >> $OUT.tmp
            echo "Location                             "$LOCATION | sed 's/"//g' >> $OUT.tmp
            echo >> $OUT.tmp
            #$LOWBATTERY
            #WARN=""
            #[ -z "$TIME_REMAIN" ] && TIME_REMAIN=0
            #[ $TIME_REMAIN -lt 1200 -a "$COLOUR" != "red" ] && COLOUR=yellow
            #[ $TIME_REMAIN -lt 1200 ] && WARN="Time Remaining low"
            #[ $TIME_REMAIN -lt 600 ] && COLOUR=red
            #[ $TIME_REMAIN -lt 600 ] && WARN="Time Remaining critical"
            #[ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            ((s=$TIME_REMAIN%60))
            ((m=$TIME_REMAIN/60))
            echo "Time Remaining                        "$m Minutes $s Seconds >> $OUT.tmp
            WARN=""
            [ -z "$BATTERY_LEVEL" ] && BATTERY_LEVEL=0
            [ $BATTERY_LEVEL -lt 95 -a "$COLOUR" != "red" ] && COLOUR=yellow
            [ $BATTERY_LEVEL -lt 95 ] && WARN="Battery level low"
            [ $BATTERY_LEVEL -lt 50 ] && COLOUR=red
            [ $BATTERY_LEVEL -lt 50 ] && WARN="Battery level critical"
            [ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            echo "Battery Level                        "$BATTERY_LEVEL % >> $OUT.tmp
            BATTERY_LEVEL=$(echo $BATTERY_LEVEL | sed 's/[ \t]*//')
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BF=Yes
               COLOUR=red
               echo "Battery Fault!" >> $OUT.warn
            else
               BF=No
            fi
            echo "Battery Fault                         "$BF >> $OUT.tmp
            if [ $BATTERY_REPLACE -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            echo "Replace Battery                       "$BR >> $OUT.tmp
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            if [ $CHARGER_FAULT -eq 1 ]
            then
               CF=Yes
               COLOUR=red
               echo "Charger Fault" >> $OUT.warn
            else
               CF=No
            fi
            echo "Charger Fault                         "$CF >> $OUT.tmp
            if [ $OUT_ON_BAT -eq 1 ]
            then
               OUT_ON_BAT=Yes
               COLOUR=red
               echo "UPS running on battery" >> $OUT.warn
            else
               OUT_ON_BAT=No
            fi
            echo "On Battery                            "$OUT_ON_BAT >> $OUT.tmp
            if [ $OUT_ON_BYPASS -eq 1 ]
            then
               OUT_ON_BYPASS=Yes
               COLOUR=red
               echo "UPS on power bypass" >> $OUT.warn
            else
               OUT_ON_BYPASS=No
            fi
            echo "On Bypass                             "$OUT_ON_BYPASS >> $OUT.tmp
            if [ $OUT_OVERLOAD -eq 1 ]
            then
               OUT_OVERLOAD=Yes
               COLOUR=red
               echo "UPS output overload" >> $OUT.warn
            else
               OUT_OVERLOAD=No
            fi
            echo "Battery Overload                      "$OUT_OVERLOAD >> $OUT.tmp
            if [ $OVERTEMP -eq 1 ]
            then
               OVERTEMP=Yes
               COLOUR=red
               echo "Unit overheating" >> $OUT.warn
            else
               OVERTEMP=No
            fi
            echo "Unit Overheating                      "$OVERTEMP >> $OUT.tmp
            #if [ $COMMSOK -eq 2 ]
            #then
            #   COMMSOK=No
            #   COLOUR=red
            #   echo "No comms from device" >> $OUT.warn
            #else
            #   COMMSOK=Yes
            #fi
            #echo "Comms OK                              "$COMMSOK >> $OUT.tmp
            echo >> $OUT.tmp
            echo "Input Phases                         "$INPHASES >> $OUT.tmp
            INVOLT=$(echo "scale=1 ; $INVOLT/10" | bc)
            echo "Input Voltage                         "$INVOLT >> $OUT.tmp
            INFREQ=$(echo "scale=1 ; $INFREQ/10" | bc)
            echo "Input Frequency                       "$INFREQ >> $OUT.tmp
            INAMPS=$(echo "scale=1 ; $INAMPS/10" | bc)
            echo "Input Current                         "$INAMPS >> $OUT.tmp
            if [ $INOK -eq 1 ]
            then
               # A silly case of reverse logic applies here
               INOK=No
               COLOUR=red
               echo "Power input outside tollerance" >> $OUT.warn
            else
               INOK=Yes
            fi
            echo "Input OK                              "$INOK >> $OUT.tmp
            [ $INFAILCAUSE -eq 1 ] && FAILCAUSE="No failures"
            [ $INFAILCAUSE -eq 2 ] && FAILCAUSE="Voltage out of tollearance"
            [ $INFAILCAUSE -eq 3 ] && FAILCAUSE="Frequency out of tollernace"
            [ $INFAILCAUSE -eq 4 ] && FAILCAUSE="No voltage - power fail"
            echo "Cause of Failure                      "$FAILCAUSE >> $OUT.tmp
            echo >> $OUT.tmp
            echo "Output Phases                        "$OUTPHASES >> $OUT.tmp
            OUTVOLT=$(echo "scale=1 ; $OUTVOLT/10" | bc)
            echo "Output Voltage                        "$OUTVOLT >> $OUT.tmp
            OUTFREQ=$(echo "scale=1 ; $OUTFREQ/10" | bc)
            echo "Output Frequency                      "$OUTFREQ >> $OUT.tmp
            OUTAMPS=$(echo "scale=1 ; $OUTAMPS/10" | bc)
            echo "Output Current                        "$OUTAMPS >> $OUT.tmp
            OUTLOAD=$(echo $OUTLOAD | sed 's/[ \t]*//')
            echo "Output Load                           "$OUTLOAD % >> $OUT.tmp
            echo >> $OUT.final
            cat $OUT.warn >> $OUT.final
            cat $OUT.tmp >> $OUT.final
            echo '<FONT COLOR="Black">' >> $OUT.final
            echo "Load=$OUTLOAD" >> $OUT.final
            echo "Charge=$BATTERY_LEVEL" >> $OUT.final
            echo '</FONT>' >> $OUT.final
            rm $OUT.tmp
            rm $OUT.warn
       esac
    else
       echo "Device Unreachable!" >> $OUT.final
       #COLOUR=yellow
    fi
    $BB $BBDISP "status $UPSNAME.ups $COLOUR $DATE $(cat $OUT.final)"
    rm $OUT.final
done

--- snip ---


From: user-9219fb9415b1@xymon.invalid [mailto:user-9219fb9415b1@xymon.invalid]
Sent: Thursday, 10 September 2009 2:18 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Antwort: RE: [hobbit] UPS monitoring using devmon


Hi Craig,
hi David,

sounds very nice.

I tried that snmpwalk. It only works with snmp V1. This is the output:

SNMPv2-SMI::mib-2.33.1.1.1.0 = STRING: "MGE UPS SYSTEMS"
SNMPv2-SMI::mib-2.33.1.1.2.0 = STRING: "Galaxy PW Single//"
SNMPv2-SMI::mib-2.33.1.1.3.0 = ""
SNMPv2-SMI::mib-2.33.1.1.4.0 = STRING: "GB (SN 49EE49044)"
SNMPv2-SMI::mib-2.33.1.1.5.0 = ""
SNMPv2-SMI::mib-2.33.1.1.6.0 = ""

As I see it, this is only the description of the UPS. I will look for the MIB of my devices.
Don't know where all the other things which I want to monitor at minimum are located in the MIB like:

Overall status or am I runnung on battery
output power
remaining battery time
temperature
I'll look at uploading it to the SF repository.
Maybe this is a stupid question, but I don't find templates and things on the SF page. Only devmon itself.
I look at http://devmon.sourceforge.net/ and at http://sourceforge.net/projects/devmon/
There is a devmon-template file there, but as I see it, it contains only the templates which are delivered with devmon itself.

It would be nice if you share your templates. You can also contact me via user-674624a37c09@xymon.invalid at daimler dot com

Thank you very much

Thorsten

Craig

-----Original Message-----
From: David Baldwin [mailto:user-cbbf693f2c89@xymon.invalid]
Sent: Thursday, 10 September 2009 11:53 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] UPS monitoring using devmon

user-9219fb9415b1@xymon.invalid wrote:
Hi,

sorry if this a little offtopic, but maybe someone has a devmon
template for the following UPS:

Emerson/Liebert HiPulse MM
MGE Galaxy Single
MGE Upsilon STS_100 Cross switch
MGE Upsilon STS_20 Cross switch

Thank you
Thorsten


If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.
I have a template for the standard UPS MIB which I could send through. I
have a little more work to do on it splitting the power status into 3
tests for input, output and battery. Should give me motivation to
complete this today and I will upload to devmon SF site.

You can check if your UPS supports the standard UPS MIB or wants a
proprietary one (substituting for myups below, and your community string
if it is not "public"):

snmpwalk -v2c -cpublic myups 1.3.6.1.2.1.33.1.1

Note that some UPS devices only support SNMPv1, so try -v1 instead of
-v2c above if it doesn't work.

David.

--
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617


Keep up to date with what's happening in Australian sport visit
http://www.ausport.gov.au

This message is intended for the addressee named and may contain
confidential and privileged information. If you are not the intended
recipient please note that any form of distribution, copying or use of
this communication or the information in it is strictly prohibited and
may be unlawful. If you receive this message in error, please delete it
and notify the sender.


DISCLAIMER:


The information contained in this email message is confidential and
for the attention of the intended recipient only.
It is not necessarily the official view or communication of the
Rodney District Council.
If you are not the intended recipient you must not disclose, copy or
distribute this message or the information in it.
If you have received this message in error, please delete or destroy
all copies of the email and notify the sender immediately.
Rodney District Council  accepts no responsibility for any effects
this email message or attachments has on the recipient network or
computer system.

If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.


NOTICE: This email and any attachments are confidential.
They may contain legally privileged information or
copyright material. You must not read, copy, use or
disclose them without authorisation. If you are not an
intended recipient, please contact us at once by return
email and then delete both messages and all attachments.


NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.
list David Baldwin · Thu, 10 Sep 2009 17:51:49 +1000 ·
Sorry all, didn't get time today to update the UPS template today.

It has separate graphs for input voltage, output phase voltages, battery
levels and separate tests/alerting on various conditions - input
voltage=0, battery time remaining <15 mins, output phase overload, etc.

David.
quoted from Vernon Everett
Oops, forgot to add the graphing bit.
 
Usual stuff.
In hobbitserver.cfg
Add "ups=ncv" to TEST2RRD=
Add "ups" to GRAPHS=
Add line NCV_ups="Load:GAUGE,Charge:GAUGE"
 
Add this to hobbitgraph.cfg
[ups]
        TITLE UPS Charge
        YAXIS Power
        -u 100
        -l 0
        DEF:u=ups.rrd:Charge:AVERAGE
        DEF:p=ups.rrd:Load:AVERAGE
        LINE2:u#00CC00:Charge
        LINE2:p#0000FF:Load
        COMMENT:\n
        GPRINT:u:LAST:Charge   \: %5.1lf%s (cur)
        GPRINT:u:MAX: \: %5.1lf%s (max)
        GPRINT:u:MIN: \: %5.1lf%s (min)
        GPRINT:u:AVERAGE: \: %5.1lf%s (avg)\n
        GPRINT:p:LAST:Load   \: %5.1lf%s (cur)
        GPRINT:p:MAX: \: %5.1lf%s (max)
        GPRINT:p:MIN: \: %5.1lf%s (min)
        GPRINT:p:AVERAGE: \: %5.1lf%s (avg)\n
Cheers
     Vernon
 
 
*From:* Everett, Vernon [mailto:user-9da1a1882f49@xymon.invalid]
*Sent:* Thursday, 10 September 2009 2:50 PM
*To:* 'user-ae9b8668bcde@xymon.invalid'
*Subject:* RE: [hobbit] Antwort: RE: [hobbit] UPS monitoring using devmon

I wrote this a while back for our MGEs.
As you can see, it predates my introduction to devmon and indicates a
complete lack of understanding of SNMP.
That being said, the code and the MIBs might give you a good
indication of where to start.
(Either that, or you can just use it as "good enough")
This was designed to run on the hobbit/xymon server.
 
I have been meaning to rewrite this, or move it to devmon, but just
haven't had the time.
(And it's doing an adequate job for now.)
 
Cheers
      V
 
bb-host entries look like this
1.2.3.4     galaxy3000    # http://1.2.3.4/ups_prop.htm ups galaxy3000
COMMENT:"Meaningful Comment if required"
2.3.4.5   Karratha_UPS    # http://2.3.4.5/ups_prop.htm ups galaxy3000
COMMENT:"Insert Comment"

 
--- snip---
 
cat ups.ksh
#!/bin/ksh
DATE=$(date)
#set -x
SPACER="                                                                           
"
BBTMP=/tmp
#BBHOSTS=/etc/hobbit/bb-hosts
#OUT=$BBTMP/upspage
BBHOSTLIST="$BBHOSTS $(grep ^include $BBHOSTS | awk '{ print $2 }')" #
Make sure we read the include files too
#grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include"
grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include" | while read
IP UPSNAME HASH URL UPS TYPE OTHER
do
   echo $IP $UPSNAME
   ping -c1 $IP > /dev/null
   if [ $? -eq 0 ]
   then
      COLOUR=green
      case $TYPE in
         galaxy3000)
$OUT.warn
$OUT.tmp
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-SMI::mib-2.33.1.1.1.0)
            DEVICE=${TEMP##*:}       # String
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-SMI::mib-2.33.1.1.2.0)
            MODEL=${TEMP##*:}        # String
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-MIB::sysLocation.0)
            LOCATION=${TEMP##*:}             # String
            TEMP=$(snmpget -v1 -c public $IP SNMPv2-SMI::mib-2.33.1.1.4.0)
            SERIAL=${TEMP##*:}               # String
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.4.8.0)
            LOWBATTERY=${TEMP##*:}           # Integer % Point at
which shutdown triggered
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.1.0)
            TIME_REMAIN=${TEMP##*:}     # Integer seconds
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.2.0)
            BATTERY_LEVEL=${TEMP##*:}   # Integer %
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.9.0)
            BATTERY_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.11.0)
            BATTERY_REPLACE=${TEMP##*:} # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.15.0)
            CHARGER_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.3.0)
            OUT_ON_BAT=${TEMP##*:}      # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.4.0)
            OUT_ON_BYPASS=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.10.0)
            OUT_OVERLOAD=${TEMP##*:}    # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.10.0)
            COMMSOK=${TEMP##*:}         # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.1.0)
            INPHASES=${TEMP##*:}        # Integer 1 or 3
 
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.2.1.2)
            INVOLT=${TEMP##*:}          # Integer 10ths of a volt
 
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.2.1.3)
            INFREQ=${TEMP##*:}          # Integer 10ths of a Hertz
 
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.2.1.6)
            INAMPS=${TEMP##*:}          # Integer 10ths of an Amp
 
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.3.0)
            INOK=${TEMP##*:}            # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.4.0)
            INFAILCAUSE=${TEMP##*:}     # Integer 1=no fault
                                     #         2=bad voltage
                                     #         3=bad frequency
                                     #         4=no voltage
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.1.0)
            OUTPHASES=${TEMP##*:}       # Integer 1 or 3
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.2)
            OUTVOLT=${TEMP##*:}         # Integer 10ths of a volt
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.3)
            OUTFREQ=${TEMP##*:}         # Integer 10ths of a Hertz
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.4)
            OUTLOAD=${TEMP##*:}         # Integer %
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.2.1.5)
            OUTAMPS=${TEMP##*:}         # Integer 10ths of an Amp
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.11.0)
            OVERTEMP=${TEMP##*:}        # Integer 1=yes 2=no
            echo "Manufacturer                          "$DEVICE | sed
's/"//g' >> $OUT.tmp
            echo "Model                                "$MODEL | sed
's/"//g' >> $OUT.tmp
            echo "Serial Number                        "$SERIAL | sed
's/"//g' >> $OUT.tmp
            echo "Location                             "$LOCATION |
sed 's/"//g' >> $OUT.tmp
            echo >> $OUT.tmp
            #$LOWBATTERY
            #WARN=""
            #[ -z "$TIME_REMAIN" ] && TIME_REMAIN=0
            #[ $TIME_REMAIN -lt 1200 -a "$COLOUR" != "red" ] &&
COLOUR=yellow
            #[ $TIME_REMAIN -lt 1200 ] && WARN="Time Remaining low"
            #[ $TIME_REMAIN -lt 600 ] && COLOUR=red
            #[ $TIME_REMAIN -lt 600 ] && WARN="Time Remaining critical"
            #[ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            ((s=$TIME_REMAIN%60))
            ((m=$TIME_REMAIN/60))
            echo "Time Remaining                        "$m Minutes $s
Seconds >> $OUT.tmp
            WARN=""
            [ -z "$BATTERY_LEVEL" ] && BATTERY_LEVEL=0
            [ $BATTERY_LEVEL -lt 95 -a "$COLOUR" != "red" ] &&
COLOUR=yellow
            [ $BATTERY_LEVEL -lt 95 ] && WARN="Battery level low"
            [ $BATTERY_LEVEL -lt 50 ] && COLOUR=red
            [ $BATTERY_LEVEL -lt 50 ] && WARN="Battery level critical"
            [ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            echo "Battery Level                        "$BATTERY_LEVEL
% >> $OUT.tmp
            BATTERY_LEVEL=$(echo $BATTERY_LEVEL | sed 's/[ \t]*//')
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BF=Yes
               COLOUR=red
               echo "Battery Fault!" >> $OUT.warn
            else
               BF=No
            fi
            echo "Battery Fault                         "$BF >> $OUT.tmp
            if [ $BATTERY_REPLACE -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            echo "Replace Battery                       "$BR >> $OUT.tmp
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            if [ $CHARGER_FAULT -eq 1 ]
            then
               CF=Yes
               COLOUR=red
               echo "Charger Fault" >> $OUT.warn
            else
               CF=No
            fi
            echo "Charger Fault                         "$CF >> $OUT.tmp
            if [ $OUT_ON_BAT -eq 1 ]
            then
               OUT_ON_BAT=Yes
               COLOUR=red
               echo "UPS running on battery" >> $OUT.warn
            else
               OUT_ON_BAT=No
            fi
            echo "On Battery                            "$OUT_ON_BAT
$OUT.tmp
            if [ $OUT_ON_BYPASS -eq 1 ]
            then
               OUT_ON_BYPASS=Yes
               COLOUR=red
               echo "UPS on power bypass" >> $OUT.warn
            else
               OUT_ON_BYPASS=No
            fi
            echo "On Bypass                            
"$OUT_ON_BYPASS >> $OUT.tmp
            if [ $OUT_OVERLOAD -eq 1 ]
            then
               OUT_OVERLOAD=Yes
               COLOUR=red
               echo "UPS output overload" >> $OUT.warn
            else
               OUT_OVERLOAD=No
            fi
            echo "Battery Overload                      "$OUT_OVERLOAD
$OUT.tmp
            if [ $OVERTEMP -eq 1 ]
            then
               OVERTEMP=Yes
               COLOUR=red
               echo "Unit overheating" >> $OUT.warn
            else
               OVERTEMP=No
            fi
            echo "Unit Overheating                      "$OVERTEMP >>
$OUT.tmp
            #if [ $COMMSOK -eq 2 ]
            #then
            #   COMMSOK=No
            #   COLOUR=red
            #   echo "No comms from device" >> $OUT.warn
            #else
            #   COMMSOK=Yes
            #fi
            #echo "Comms OK                              "$COMMSOK >>
$OUT.tmp
            echo >> $OUT.tmp
            echo "Input Phases                         "$INPHASES >>
$OUT.tmp
            INVOLT=$(echo "scale=1 ; $INVOLT/10" | bc)
            echo "Input Voltage                         "$INVOLT >>
$OUT.tmp
            INFREQ=$(echo "scale=1 ; $INFREQ/10" | bc)
            echo "Input Frequency                       "$INFREQ >>
$OUT.tmp
            INAMPS=$(echo "scale=1 ; $INAMPS/10" | bc)
            echo "Input Current                         "$INAMPS >>
$OUT.tmp
            if [ $INOK -eq 1 ]
            then
               # A silly case of reverse logic applies here
               INOK=No
               COLOUR=red
               echo "Power input outside tollerance" >> $OUT.warn
            else
               INOK=Yes
            fi
            echo "Input OK                              "$INOK >> $OUT.tmp
            [ $INFAILCAUSE -eq 1 ] && FAILCAUSE="No failures"
            [ $INFAILCAUSE -eq 2 ] && FAILCAUSE="Voltage out of
tollearance"
            [ $INFAILCAUSE -eq 3 ] && FAILCAUSE="Frequency out of
tollernace"
            [ $INFAILCAUSE -eq 4 ] && FAILCAUSE="No voltage - power fail"
            echo "Cause of Failure                      "$FAILCAUSE >>
$OUT.tmp
            echo >> $OUT.tmp
            echo "Output Phases                        "$OUTPHASES >>
$OUT.tmp
            OUTVOLT=$(echo "scale=1 ; $OUTVOLT/10" | bc)
            echo "Output Voltage                        "$OUTVOLT >>
$OUT.tmp
            OUTFREQ=$(echo "scale=1 ; $OUTFREQ/10" | bc)
            echo "Output Frequency                      "$OUTFREQ >>
$OUT.tmp
            OUTAMPS=$(echo "scale=1 ; $OUTAMPS/10" | bc)
            echo "Output Current                        "$OUTAMPS >>
$OUT.tmp
            OUTLOAD=$(echo $OUTLOAD | sed 's/[ \t]*//')
            echo "Output Load                           "$OUTLOAD % >>
$OUT.tmp
            echo >> $OUT.final
            cat $OUT.warn >> $OUT.final
            cat $OUT.tmp >> $OUT.final
            echo '<FONT COLOR="Black">' >> $OUT.final
            echo "Load=$OUTLOAD" >> $OUT.final
            echo "Charge=$BATTERY_LEVEL" >> $OUT.final
            echo '</FONT>' >> $OUT.final
            rm $OUT.tmp
            rm $OUT.warn
       esac
    else
       echo "Device Unreachable!" >> $OUT.final
       #COLOUR=yellow
    fi
    $BB $BBDISP "status $UPSNAME.ups $COLOUR $DATE $(cat $OUT.final)"
    rm $OUT.final
done
 
--- snip ---
 
 
*From:* user-9219fb9415b1@xymon.invalid
[mailto:user-9219fb9415b1@xymon.invalid]
*Sent:* Thursday, 10 September 2009 2:18 PM
*To:* user-ae9b8668bcde@xymon.invalid
*Subject:* [hobbit] Antwort: RE: [hobbit] UPS monitoring using devmon


Hi Craig,
hi David,

sounds very nice.

I tried that snmpwalk. It only works with snmp V1. This is the output:

SNMPv2-SMI::mib-2.33.1.1.1.0 = STRING: "MGE UPS SYSTEMS"
SNMPv2-SMI::mib-2.33.1.1.2.0 = STRING: "Galaxy PW Single//"
SNMPv2-SMI::mib-2.33.1.1.3.0 = ""
SNMPv2-SMI::mib-2.33.1.1.4.0 = STRING: "GB (SN 49EE49044)"
SNMPv2-SMI::mib-2.33.1.1.5.0 = ""
SNMPv2-SMI::mib-2.33.1.1.6.0 = ""

As I see it, this is only the description of the UPS. I will look for
the MIB of my devices.
Don't know where all the other things which I want to monitor at
minimum are located in the MIB like:

Overall status or am I runnung on battery
output power
remaining battery time
temperature
I'll look at uploading it to the SF repository.
Maybe this is a stupid question, but I don't find templates and things
on the SF page. Only devmon itself.
I look at http://devmon.sourceforge.net/ and at
http://sourceforge.net/projects/devmon/
There is a devmon-template file there, but as I see it, it contains
only the templates which are delivered with devmon itself.

It would be nice if you share your templates. You can also contact me
via user-674624a37c09@xymon.invalid at daimler dot com

Thank you very much

Thorsten

Craig

-----Original Message-----
From: David Baldwin [mailto:user-cbbf693f2c89@xymon.invalid]
Sent: Thursday, 10 September 2009 11:53 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] UPS monitoring using devmon

user-9219fb9415b1@xymon.invalid wrote:
Hi,

sorry if this a little offtopic, but maybe someone has a devmon
template for the following UPS:

Emerson/Liebert HiPulse MM
MGE Galaxy Single
MGE Upsilon STS_100 Cross switch
MGE Upsilon STS_20 Cross switch

Thank you
Thorsten


If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.
I have a template for the standard UPS MIB which I could send through. I
have a little more work to do on it splitting the power status into 3
tests for input, output and battery. Should give me motivation to
complete this today and I will upload to devmon SF site.

You can check if your UPS supports the standard UPS MIB or wants a
proprietary one (substituting for myups below, and your community string
if it is not "public"):

snmpwalk -v2c -cpublic myups 1.3.6.1.2.1.33.1.1

Note that some UPS devices only support SNMPv1, so try -v1 instead of
-v2c above if it doesn't work.

David.

--
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617


Keep up to date with what's happening in Australian sport visit
http://www.ausport.gov.au

This message is intended for the addressee named and may contain
confidential and privileged information. If you are not the intended
recipient please note that any form of distribution, copying or use of
this communication or the information in it is strictly prohibited and
may be unlawful. If you receive this message in error, please delete it
and notify the sender.


DISCLAIMER:
 

The information contained in this email message is confidential and
for the attention of the intended recipient only.
It is not necessarily the official view or communication of the
Rodney District Council.
If you are not the intended recipient you must not disclose, copy or
distribute this message or the information in it.
If you have received this message in error, please delete or destroy
all copies of the email and notify the sender immediately.
Rodney District Council  accepts no responsibility for any effects
this email message or attachments has on the recipient network or
computer system.

If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.

NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.
  
NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.
  
-- 
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617
list Thorsten Erdmann · Thu, 10 Sep 2009 17:16:34 +0200 ·
Hi

I try to get some temperature graphs of my UPS. The UPS test produces broken numbers like this:

Temperature status:

Warning level:  35 C
Alarm level  :  40 C

Device                  Temp(C)  Temp(F)
 Ambient                20.7       69


Devmon version 0.3.1-beta1 running on s068a300


I manged to get the numbers into a graph if I alter the output to not showing 20.7, instead showing 21.
The graph show up several lines like

Ambient_______20.
Ambient_______21.

It seems the number is been slitted at the point instead of using the broken number. What can I do against that behavior?
quoted from David Baldwin

Thorsten Erdmann


If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Thorsten Erdmann · Thu, 10 Sep 2009 17:19:44 +0200 ·
Hi David

your example was very helpfull. I now managed to get a working devmon 
template for my MGE UPS. Only graphing isn't working now.

BTW.: anyone knows how I can format output numbers in devmon. I now get 
the voltages with two digits behind the colon, but these are always zero. 
So I want to omit these digits at all.


Thorsten Erdmann


user-cbbf693f2c89@xymon.invalid schrieb am 10.09.2009 09:51:49:
quoted from David Baldwin
Sorry all, didn't get time today to update the UPS template today.

It has separate graphs for input voltage, output phase voltages, battery
levels and separate tests/alerting on various conditions - input
voltage=0, battery time remaining <15 mins, output phase overload, etc.

David.
Oops, forgot to add the graphing bit.

Usual stuff.
In hobbitserver.cfg
Add "ups=ncv" to TEST2RRD=
Add "ups" to GRAPHS=
Add line NCV_ups="Load:GAUGE,Charge:GAUGE"

Add this to hobbitgraph.cfg
[ups]
        TITLE UPS Charge
        YAXIS Power
        -u 100
        -l 0
        DEF:u=ups.rrd:Charge:AVERAGE
        DEF:p=ups.rrd:Load:AVERAGE
        LINE2:u#00CC00:Charge
        LINE2:p#0000FF:Load
        COMMENT:\n
        GPRINT:u:LAST:Charge   \: %5.1lf%s (cur)
        GPRINT:u:MAX: \: %5.1lf%s (max)
        GPRINT:u:MIN: \: %5.1lf%s (min)
        GPRINT:u:AVERAGE: \: %5.1lf%s (avg)\n
        GPRINT:p:LAST:Load   \: %5.1lf%s (cur)
        GPRINT:p:MAX: \: %5.1lf%s (max)
        GPRINT:p:MIN: \: %5.1lf%s (min)
        GPRINT:p:AVERAGE: \: %5.1lf%s (avg)\n
Cheers
     Vernon


*From:* Everett, Vernon [mailto:user-9da1a1882f49@xymon.invalid]
*Sent:* Thursday, 10 September 2009 2:50 PM
*To:* 'user-ae9b8668bcde@xymon.invalid'
*Subject:* RE: [hobbit] Antwort: RE: [hobbit] UPS monitoring using 
devmon

I wrote this a while back for our MGEs.
As you can see, it predates my introduction to devmon and indicates a
complete lack of understanding of SNMP.
That being said, the code and the MIBs might give you a good
indication of where to start.
(Either that, or you can just use it as "good enough")
This was designed to run on the hobbit/xymon server.

I have been meaning to rewrite this, or move it to devmon, but just
haven't had the time.
(And it's doing an adequate job for now.)

Cheers
      V

bb-host entries look like this
1.2.3.4     galaxy3000    # http://1.2.3.4/ups_prop.htm ups galaxy3000
COMMENT:"Meaningful Comment if required"
2.3.4.5   Karratha_UPS    # http://2.3.4.5/ups_prop.htm ups galaxy3000
COMMENT:"Insert Comment"


--- snip---

cat ups.ksh
#!/bin/ksh
DATE=$(date)
#set -x
SPACER="  
"
BBTMP=/tmp
#BBHOSTS=/etc/hobbit/bb-hosts
#OUT=$BBTMP/upspage
BBHOSTLIST="$BBHOSTS $(grep ^include $BBHOSTS | awk '{ print $2 }')" #
Make sure we read the include files too
#grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include"
grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include" | while read
IP UPSNAME HASH URL UPS TYPE OTHER
do
   echo $IP $UPSNAME
   ping -c1 $IP > /dev/null
   if [ $? -eq 0 ]
   then
      COLOUR=green
      case $TYPE in
         galaxy3000)
$OUT.warn
$OUT.tmp
            TEMP=$(snmpget -v1 -c public $IP 
SNMPv2-SMI::mib-2.33.1.1.1.0)
            DEVICE=${TEMP##*:}       # String
            TEMP=$(snmpget -v1 -c public $IP 
SNMPv2-SMI::mib-2.33.1.1.2.0)
            MODEL=${TEMP##*:}        # String
            TEMP=$(snmpget -v1 -c public $IP 
SNMPv2-MIB::sysLocation.0)
            LOCATION=${TEMP##*:}             # String
            TEMP=$(snmpget -v1 -c public $IP 
SNMPv2-SMI::mib-2.33.1.1.4.0)
            SERIAL=${TEMP##*:}               # String
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.4.8.0)
            LOWBATTERY=${TEMP##*:}           # Integer % Point at
which shutdown triggered
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.1.0)
            TIME_REMAIN=${TEMP##*:}     # Integer seconds
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.2.0)
            BATTERY_LEVEL=${TEMP##*:}   # Integer %
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.9.0)
            BATTERY_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.11.0)
            BATTERY_REPLACE=${TEMP##*:} # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.15.0)
            CHARGER_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.3.0)
            OUT_ON_BAT=${TEMP##*:}      # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.4.0)
            OUT_ON_BYPASS=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.10.0)
            OUT_OVERLOAD=${TEMP##*:}    # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.10.0)
            COMMSOK=${TEMP##*:}         # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.1.0)
            INPHASES=${TEMP##*:}        # Integer 1 or 3

            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.6.2.1.2)
            INVOLT=${TEMP##*:}          # Integer 10ths of a volt

            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.6.2.1.3)
            INFREQ=${TEMP##*:}          # Integer 10ths of a Hertz

            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.6.2.1.6)
            INAMPS=${TEMP##*:}          # Integer 10ths of an Amp

            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.3.0)
            INOK=${TEMP##*:}            # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.4.0)
            INFAILCAUSE=${TEMP##*:}     # Integer 1=no fault
                                     #         2=bad voltage
                                     #         3=bad frequency
                                     #         4=no voltage
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.1.0)
            OUTPHASES=${TEMP##*:}       # Integer 1 or 3
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.2.1.2)
            OUTVOLT=${TEMP##*:}         # Integer 10ths of a volt
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.2.1.3)
            OUTFREQ=${TEMP##*:}         # Integer 10ths of a Hertz
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.2.1.4)
            OUTLOAD=${TEMP##*:}         # Integer %
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.2.1.5)
            OUTAMPS=${TEMP##*:}         # Integer 10ths of an Amp
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.11.0)
            OVERTEMP=${TEMP##*:}        # Integer 1=yes 2=no
            echo "Manufacturer                          "$DEVICE | sed
's/"//g' >> $OUT.tmp
            echo "Model                                "$MODEL | sed
's/"//g' >> $OUT.tmp
            echo "Serial Number                        "$SERIAL | sed
's/"//g' >> $OUT.tmp
            echo "Location                             "$LOCATION |
sed 's/"//g' >> $OUT.tmp
            echo >> $OUT.tmp
            #$LOWBATTERY
            #WARN=""
            #[ -z "$TIME_REMAIN" ] && TIME_REMAIN=0
            #[ $TIME_REMAIN -lt 1200 -a "$COLOUR" != "red" ] &&
COLOUR=yellow
            #[ $TIME_REMAIN -lt 1200 ] && WARN="Time Remaining low"
            #[ $TIME_REMAIN -lt 600 ] && COLOUR=red
            #[ $TIME_REMAIN -lt 600 ] && WARN="Time Remaining 
critical"
            #[ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            ((s=$TIME_REMAIN%60))
            ((m=$TIME_REMAIN/60))
            echo "Time Remaining                        "$m Minutes $s
Seconds >> $OUT.tmp
            WARN=""
            [ -z "$BATTERY_LEVEL" ] && BATTERY_LEVEL=0
            [ $BATTERY_LEVEL -lt 95 -a "$COLOUR" != "red" ] &&
COLOUR=yellow
            [ $BATTERY_LEVEL -lt 95 ] && WARN="Battery level low"
            [ $BATTERY_LEVEL -lt 50 ] && COLOUR=red
            [ $BATTERY_LEVEL -lt 50 ] && WARN="Battery level critical"
            [ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            echo "Battery Level                        "$BATTERY_LEVEL
% >> $OUT.tmp
            BATTERY_LEVEL=$(echo $BATTERY_LEVEL | sed 's/[ \t]*//')
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BF=Yes
               COLOUR=red
               echo "Battery Fault!" >> $OUT.warn
            else
               BF=No
            fi
            echo "Battery Fault                         "$BF >> 
$OUT.tmp
            if [ $BATTERY_REPLACE -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            echo "Replace Battery                       "$BR >> 
$OUT.tmp
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            if [ $CHARGER_FAULT -eq 1 ]
            then
               CF=Yes
               COLOUR=red
               echo "Charger Fault" >> $OUT.warn
            else
               CF=No
            fi
            echo "Charger Fault                         "$CF >> 
$OUT.tmp
            if [ $OUT_ON_BAT -eq 1 ]
            then
               OUT_ON_BAT=Yes
               COLOUR=red
               echo "UPS running on battery" >> $OUT.warn
            else
               OUT_ON_BAT=No
            fi
            echo "On Battery                            "$OUT_ON_BAT
$OUT.tmp
            if [ $OUT_ON_BYPASS -eq 1 ]
            then
               OUT_ON_BYPASS=Yes
               COLOUR=red
               echo "UPS on power bypass" >> $OUT.warn
            else
               OUT_ON_BYPASS=No
            fi
            echo "On Bypass 
"$OUT_ON_BYPASS >> $OUT.tmp
            if [ $OUT_OVERLOAD -eq 1 ]
            then
               OUT_OVERLOAD=Yes
               COLOUR=red
               echo "UPS output overload" >> $OUT.warn
            else
               OUT_OVERLOAD=No
            fi
            echo "Battery Overload                      "$OUT_OVERLOAD
$OUT.tmp
            if [ $OVERTEMP -eq 1 ]
            then
               OVERTEMP=Yes
               COLOUR=red
               echo "Unit overheating" >> $OUT.warn
            else
               OVERTEMP=No
            fi
            echo "Unit Overheating                      "$OVERTEMP >>
$OUT.tmp
            #if [ $COMMSOK -eq 2 ]
            #then
            #   COMMSOK=No
            #   COLOUR=red
            #   echo "No comms from device" >> $OUT.warn
            #else
            #   COMMSOK=Yes
            #fi
            #echo "Comms OK                              "$COMMSOK >>
$OUT.tmp
            echo >> $OUT.tmp
            echo "Input Phases                         "$INPHASES >>
$OUT.tmp
            INVOLT=$(echo "scale=1 ; $INVOLT/10" | bc)
            echo "Input Voltage                         "$INVOLT >>
$OUT.tmp
            INFREQ=$(echo "scale=1 ; $INFREQ/10" | bc)
            echo "Input Frequency                       "$INFREQ >>
$OUT.tmp
            INAMPS=$(echo "scale=1 ; $INAMPS/10" | bc)
            echo "Input Current                         "$INAMPS >>
$OUT.tmp
            if [ $INOK -eq 1 ]
            then
               # A silly case of reverse logic applies here
               INOK=No
               COLOUR=red
               echo "Power input outside tollerance" >> $OUT.warn
            else
               INOK=Yes
            fi
            echo "Input OK                              "$INOK >> 
$OUT.tmp
            [ $INFAILCAUSE -eq 1 ] && FAILCAUSE="No failures"
            [ $INFAILCAUSE -eq 2 ] && FAILCAUSE="Voltage out of
tollearance"
            [ $INFAILCAUSE -eq 3 ] && FAILCAUSE="Frequency out of
tollernace"
            [ $INFAILCAUSE -eq 4 ] && FAILCAUSE="No voltage - power 
fail"
            echo "Cause of Failure                      "$FAILCAUSE >>
$OUT.tmp
            echo >> $OUT.tmp
            echo "Output Phases                        "$OUTPHASES >>
$OUT.tmp
            OUTVOLT=$(echo "scale=1 ; $OUTVOLT/10" | bc)
            echo "Output Voltage                        "$OUTVOLT >>
$OUT.tmp
            OUTFREQ=$(echo "scale=1 ; $OUTFREQ/10" | bc)
            echo "Output Frequency                      "$OUTFREQ >>
$OUT.tmp
            OUTAMPS=$(echo "scale=1 ; $OUTAMPS/10" | bc)
            echo "Output Current                        "$OUTAMPS >>
$OUT.tmp
            OUTLOAD=$(echo $OUTLOAD | sed 's/[ \t]*//')
            echo "Output Load                           "$OUTLOAD % >>
$OUT.tmp
            echo >> $OUT.final
            cat $OUT.warn >> $OUT.final
            cat $OUT.tmp >> $OUT.final
            echo '<FONT COLOR="Black">' >> $OUT.final
            echo "Load=$OUTLOAD" >> $OUT.final
            echo "Charge=$BATTERY_LEVEL" >> $OUT.final
            echo '</FONT>' >> $OUT.final
            rm $OUT.tmp
            rm $OUT.warn
       esac
    else
       echo "Device Unreachable!" >> $OUT.final
       #COLOUR=yellow
    fi
    $BB $BBDISP "status $UPSNAME.ups $COLOUR $DATE $(cat $OUT.final)"
    rm $OUT.final
done

--- snip ---


*From:* user-9219fb9415b1@xymon.invalid
[mailto:user-9219fb9415b1@xymon.invalid]
*Sent:* Thursday, 10 September 2009 2:18 PM
*To:* user-ae9b8668bcde@xymon.invalid
*Subject:* [hobbit] Antwort: RE: [hobbit] UPS monitoring using devmon


Hi Craig,
hi David,

sounds very nice.

I tried that snmpwalk. It only works with snmp V1. This is the output:

SNMPv2-SMI::mib-2.33.1.1.1.0 = STRING: "MGE UPS SYSTEMS"
SNMPv2-SMI::mib-2.33.1.1.2.0 = STRING: "Galaxy PW Single//"
SNMPv2-SMI::mib-2.33.1.1.3.0 = ""
SNMPv2-SMI::mib-2.33.1.1.4.0 = STRING: "GB (SN 49EE49044)"
SNMPv2-SMI::mib-2.33.1.1.5.0 = ""
SNMPv2-SMI::mib-2.33.1.1.6.0 = ""

As I see it, this is only the description of the UPS. I will look for
the MIB of my devices.
Don't know where all the other things which I want to monitor at
minimum are located in the MIB like:

Overall status or am I runnung on battery
output power
remaining battery time
temperature
I'll look at uploading it to the SF repository.
Maybe this is a stupid question, but I don't find templates and things
on the SF page. Only devmon itself.
I look at http://devmon.sourceforge.net/ and at
http://sourceforge.net/projects/devmon/
There is a devmon-template file there, but as I see it, it contains
only the templates which are delivered with devmon itself.

It would be nice if you share your templates. You can also contact me
via user-674624a37c09@xymon.invalid at daimler dot com

Thank you very much

Thorsten

Craig

-----Original Message-----
From: David Baldwin [mailto:user-cbbf693f2c89@xymon.invalid]
Sent: Thursday, 10 September 2009 11:53 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] UPS monitoring using devmon

user-9219fb9415b1@xymon.invalid wrote:
Hi,

sorry if this a little offtopic, but maybe someone has a devmon
template for the following UPS:

Emerson/Liebert HiPulse MM
MGE Galaxy Single
MGE Upsilon STS_100 Cross switch
MGE Upsilon STS_20 Cross switch

Thank you
Thorsten


If you are not the intended addressee, please inform us 
immediately
that you have received this e-mail in error, and delete it. We 
thank
you for your cooperation.
I have a template for the standard UPS MIB which I could send 
through. I
have a little more work to do on it splitting the power status into 
3
tests for input, output and battery. Should give me motivation to
complete this today and I will upload to devmon SF site.

You can check if your UPS supports the standard UPS MIB or wants a
proprietary one (substituting for myups below, and your community 
string
if it is not "public"):

snmpwalk -v2c -cpublic myups 1.3.6.1.2.1.33.1.1

Note that some UPS devices only support SNMPv1, so try -v1 instead 
of
-v2c above if it doesn't work.

David.

--
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 
2617

Keep up to date with what's happening in Australian sport visit
http://www.ausport.gov.au

This message is intended for the addressee named and may contain
confidential and privileged information. If you are not the intended
recipient please note that any form of distribution, copying or use 
of
this communication or the information in it is strictly prohibited 
and
may be unlawful. If you receive this message in error, please delete 
it
and notify the sender.


DISCLAIMER:


The information contained in this email message is confidential and
for the attention of the intended recipient only.
It is not necessarily the official view or communication of the
Rodney District Council.
If you are not the intended recipient you must not disclose, copy or
distribute this message or the information in it.
If you have received this message in error, please delete or destroy
all copies of the email and notify the sender immediately.
Rodney District Council  accepts no responsibility for any effects
this email message or attachments has on the recipient network or
computer system.

If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.

NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.

NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.
-- 
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617

If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list David Baldwin · Fri, 11 Sep 2009 15:26:30 +1000 ·
My UPS template has been tweaked and is now available from the devmon SF
repository:
http://devmon.svn.sourceforge.net/viewvc/devmon/trunk/templates/ups.tar.gz?view=tar

README file includes hobbitgraph.cfg section and info on setting up RRD
collection and graphing.

Let me know if any problems. The msgs test attempts to show the
AlarmDesc repeater which is empty unless there are any alarms which may
cause issues - I've increased the number of "not found" repeaters
slightly in my copy of devmon to be more lenient. The line is in
modules/dm_snmp.pm

  if($failed_query > 2) {

I increased 2 to 6.
quoted from Thorsten Erdmann

your example was very helpfull. I now managed to get a working devmon
template for my MGE UPS. Only graphing isn't working now.

BTW.: anyone knows how I can format output numbers in devmon. I now
get the voltages with two digits behind the colon, but these are
always zero. So I want to omit these digits at all.
The number of decimal digits displayed is controlled in the transforms
file with MATH operator by adding ": N" - e.g.

upsInputCurrentA      : MATH  : {upsInputCurrent} / 10 : 1

will display for example 10.1 - change to ": 0" to get 10

David.
quoted from Thorsten Erdmann
Thorsten Erdmann


user-cbbf693f2c89@xymon.invalid schrieb am 10.09.2009 09:51:49:
Sorry all, didn't get time today to update the UPS template today.

It has separate graphs for input voltage, output phase voltages, battery
levels and separate tests/alerting on various conditions - input
voltage=0, battery time remaining <15 mins, output phase overload, etc.

David.
Oops, forgot to add the graphing bit.
 
Usual stuff.
In hobbitserver.cfg
Add "ups=ncv" to TEST2RRD=
Add "ups" to GRAPHS=
Add line NCV_ups="Load:GAUGE,Charge:GAUGE"
 
Add this to hobbitgraph.cfg
[ups]
        TITLE UPS Charge
        YAXIS Power
        -u 100
        -l 0
        DEF:u=ups.rrd:Charge:AVERAGE
        DEF:p=ups.rrd:Load:AVERAGE
        LINE2:u#00CC00:Charge
        LINE2:p#0000FF:Load
        COMMENT:\n
        GPRINT:u:LAST:Charge   \: %5.1lf%s (cur)
        GPRINT:u:MAX: \: %5.1lf%s (max)
        GPRINT:u:MIN: \: %5.1lf%s (min)
        GPRINT:u:AVERAGE: \: %5.1lf%s (avg)\n
        GPRINT:p:LAST:Load   \: %5.1lf%s (cur)
        GPRINT:p:MAX: \: %5.1lf%s (max)
        GPRINT:p:MIN: \: %5.1lf%s (min)
        GPRINT:p:AVERAGE: \: %5.1lf%s (avg)\n
Cheers
     Vernon
 
 
*From:* Everett, Vernon [mailto:user-9da1a1882f49@xymon.invalid]
*Sent:* Thursday, 10 September 2009 2:50 PM
*To:* 'user-ae9b8668bcde@xymon.invalid'
*Subject:* RE: [hobbit] Antwort: RE: [hobbit] UPS monitoring using
devmon

I wrote this a while back for our MGEs.
As you can see, it predates my introduction to devmon and indicates a
complete lack of understanding of SNMP.
That being said, the code and the MIBs might give you a good
indication of where to start.
(Either that, or you can just use it as "good enough")
This was designed to run on the hobbit/xymon server.
 
I have been meaning to rewrite this, or move it to devmon, but just
haven't had the time.
(And it's doing an adequate job for now.)
 
Cheers
      V
 
bb-host entries look like this
1.2.3.4     galaxy3000    # http://1.2.3.4/ups_prop.htm ups galaxy3000
COMMENT:"Meaningful Comment if required"
2.3.4.5   Karratha_UPS    # http://2.3.4.5/ups_prop.htm ups galaxy3000
COMMENT:"Insert Comment"

 
--- snip---
 
cat ups.ksh
#!/bin/ksh
DATE=$(date)
#set -x
SPACER="                                                          
       
"
BBTMP=/tmp
#BBHOSTS=/etc/hobbit/bb-hosts
#OUT=$BBTMP/upspage
BBHOSTLIST="$BBHOSTS $(grep ^include $BBHOSTS | awk '{ print $2 }')" #
Make sure we read the include files too
#grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include"
grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include" | while read
IP UPSNAME HASH URL UPS TYPE OTHER
do
   echo $IP $UPSNAME
   ping -c1 $IP > /dev/null
   if [ $? -eq 0 ]
   then
      COLOUR=green
      case $TYPE in
         galaxy3000)
$OUT.warn
$OUT.tmp
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-SMI::mib-2.33.1.1.1.0)
            DEVICE=${TEMP##*:}       # String
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-SMI::mib-2.33.1.1.2.0)
            MODEL=${TEMP##*:}        # String
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-MIB::sysLocation.0)
            LOCATION=${TEMP##*:}             # String
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-SMI::mib-2.33.1.1.4.0)
            SERIAL=${TEMP##*:}               # String
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.4.8.0)
            LOWBATTERY=${TEMP##*:}           # Integer % Point at
which shutdown triggered
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.1.0)
            TIME_REMAIN=${TEMP##*:}     # Integer seconds
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.2.0)
            BATTERY_LEVEL=${TEMP##*:}   # Integer %
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.9.0)
            BATTERY_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.11.0)
            BATTERY_REPLACE=${TEMP##*:} # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.5.15.0)
            CHARGER_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.3.0)
            OUT_ON_BAT=${TEMP##*:}      # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.4.0)
            OUT_ON_BYPASS=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.10.0)
            OUT_OVERLOAD=${TEMP##*:}    # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.10.0)
            COMMSOK=${TEMP##*:}         # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.1.0)
            INPHASES=${TEMP##*:}        # Integer 1 or 3
 
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.6.2.1.2)
            INVOLT=${TEMP##*:}          # Integer 10ths of a volt
 
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.6.2.1.3)
            INFREQ=${TEMP##*:}          # Integer 10ths of a Hertz
 
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.6.2.1.6)
            INAMPS=${TEMP##*:}          # Integer 10ths of an Amp
 
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.3.0)
            INOK=${TEMP##*:}            # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.6.4.0)
            INFAILCAUSE=${TEMP##*:}     # Integer 1=no fault
                                     #         2=bad voltage
                                     #         3=bad frequency
                                     #         4=no voltage
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.1.0)
            OUTPHASES=${TEMP##*:}       # Integer 1 or 3
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.2)
            OUTVOLT=${TEMP##*:}         # Integer 10ths of a volt
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.3)
            OUTFREQ=${TEMP##*:}         # Integer 10ths of a Hertz
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.4)
            OUTLOAD=${TEMP##*:}         # Integer %
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.5)
            OUTAMPS=${TEMP##*:}         # Integer 10ths of an Amp
            TEMP=$(snmpget -v1 -c public $IP 1.3.6.1.4.1.705.1.7.11.0)
            OVERTEMP=${TEMP##*:}        # Integer 1=yes 2=no
            echo "Manufacturer                          "$DEVICE | sed
's/"//g' >> $OUT.tmp
            echo "Model                                "$MODEL | sed
's/"//g' >> $OUT.tmp
            echo "Serial Number                        "$SERIAL | sed
's/"//g' >> $OUT.tmp
            echo "Location                             "$LOCATION |
sed 's/"//g' >> $OUT.tmp
            echo >> $OUT.tmp
            #$LOWBATTERY
            #WARN=""
            #[ -z "$TIME_REMAIN" ] && TIME_REMAIN=0
            #[ $TIME_REMAIN -lt 1200 -a "$COLOUR" != "red" ] &&
COLOUR=yellow
            #[ $TIME_REMAIN -lt 1200 ] && WARN="Time Remaining low"
            #[ $TIME_REMAIN -lt 600 ] && COLOUR=red
            #[ $TIME_REMAIN -lt 600 ] && WARN="Time Remaining
critical"
            #[ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            ((s=$TIME_REMAIN%60))
            ((m=$TIME_REMAIN/60))
            echo "Time Remaining                        "$m Minutes $s
Seconds >> $OUT.tmp
            WARN=""
            [ -z "$BATTERY_LEVEL" ] && BATTERY_LEVEL=0
            [ $BATTERY_LEVEL -lt 95 -a "$COLOUR" != "red" ] &&
COLOUR=yellow
            [ $BATTERY_LEVEL -lt 95 ] && WARN="Battery level low"
            [ $BATTERY_LEVEL -lt 50 ] && COLOUR=red
            [ $BATTERY_LEVEL -lt 50 ] && WARN="Battery level critical"
            [ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            echo "Battery Level                        "$BATTERY_LEVEL
% >> $OUT.tmp
            BATTERY_LEVEL=$(echo $BATTERY_LEVEL | sed 's/[ \t]*//')
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BF=Yes
               COLOUR=red
               echo "Battery Fault!" >> $OUT.warn
            else
               BF=No
            fi
            echo "Battery Fault                         "$BF >>
$OUT.tmp
            if [ $BATTERY_REPLACE -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            echo "Replace Battery                       "$BR >>
$OUT.tmp
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            if [ $CHARGER_FAULT -eq 1 ]
            then
               CF=Yes
               COLOUR=red
               echo "Charger Fault" >> $OUT.warn
            else
               CF=No
            fi
            echo "Charger Fault                         "$CF >>
$OUT.tmp
            if [ $OUT_ON_BAT -eq 1 ]
            then
               OUT_ON_BAT=Yes
               COLOUR=red
               echo "UPS running on battery" >> $OUT.warn
            else
               OUT_ON_BAT=No
            fi
            echo "On Battery                            "$OUT_ON_BAT
$OUT.tmp
            if [ $OUT_ON_BYPASS -eq 1 ]
            then
               OUT_ON_BYPASS=Yes
               COLOUR=red
               echo "UPS on power bypass" >> $OUT.warn
            else
               OUT_ON_BYPASS=No
            fi
            echo "On Bypass                            
"$OUT_ON_BYPASS >> $OUT.tmp
            if [ $OUT_OVERLOAD -eq 1 ]
            then
               OUT_OVERLOAD=Yes
               COLOUR=red
               echo "UPS output overload" >> $OUT.warn
            else
               OUT_OVERLOAD=No
            fi
            echo "Battery Overload                      "$OUT_OVERLOAD
$OUT.tmp
            if [ $OVERTEMP -eq 1 ]
            then
               OVERTEMP=Yes
               COLOUR=red
               echo "Unit overheating" >> $OUT.warn
            else
               OVERTEMP=No
            fi
            echo "Unit Overheating                      "$OVERTEMP >>
$OUT.tmp
            #if [ $COMMSOK -eq 2 ]
            #then
            #   COMMSOK=No
            #   COLOUR=red
            #   echo "No comms from device" >> $OUT.warn
            #else
            #   COMMSOK=Yes
            #fi
            #echo "Comms OK                              "$COMMSOK >>
$OUT.tmp
            echo >> $OUT.tmp
            echo "Input Phases                         "$INPHASES >>
$OUT.tmp
            INVOLT=$(echo "scale=1 ; $INVOLT/10" | bc)
            echo "Input Voltage                         "$INVOLT >>
$OUT.tmp
            INFREQ=$(echo "scale=1 ; $INFREQ/10" | bc)
            echo "Input Frequency                       "$INFREQ >>
$OUT.tmp
            INAMPS=$(echo "scale=1 ; $INAMPS/10" | bc)
            echo "Input Current                         "$INAMPS >>
$OUT.tmp
            if [ $INOK -eq 1 ]
            then
               # A silly case of reverse logic applies here
               INOK=No
               COLOUR=red
               echo "Power input outside tollerance" >> $OUT.warn
            else
               INOK=Yes
            fi
            echo "Input OK                              "$INOK >>
$OUT.tmp
            [ $INFAILCAUSE -eq 1 ] && FAILCAUSE="No failures"
            [ $INFAILCAUSE -eq 2 ] && FAILCAUSE="Voltage out of
tollearance"
            [ $INFAILCAUSE -eq 3 ] && FAILCAUSE="Frequency out of
tollernace"
            [ $INFAILCAUSE -eq 4 ] && FAILCAUSE="No voltage -
power fail"
            echo "Cause of Failure                      "$FAILCAUSE >>
$OUT.tmp
            echo >> $OUT.tmp
            echo "Output Phases                        "$OUTPHASES >>
$OUT.tmp
            OUTVOLT=$(echo "scale=1 ; $OUTVOLT/10" | bc)
            echo "Output Voltage                        "$OUTVOLT >>
$OUT.tmp
            OUTFREQ=$(echo "scale=1 ; $OUTFREQ/10" | bc)
            echo "Output Frequency                      "$OUTFREQ >>
$OUT.tmp
            OUTAMPS=$(echo "scale=1 ; $OUTAMPS/10" | bc)
            echo "Output Current                        "$OUTAMPS >>
$OUT.tmp
            OUTLOAD=$(echo $OUTLOAD | sed 's/[ \t]*//')
            echo "Output Load                           "$OUTLOAD % >>
$OUT.tmp
            echo >> $OUT.final
            cat $OUT.warn >> $OUT.final
            cat $OUT.tmp >> $OUT.final
            echo '<FONT COLOR="Black">' >> $OUT.final
            echo "Load=$OUTLOAD" >> $OUT.final
            echo "Charge=$BATTERY_LEVEL" >> $OUT.final
            echo '</FONT>' >> $OUT.final
            rm $OUT.tmp
            rm $OUT.warn
       esac
    else
       echo "Device Unreachable!" >> $OUT.final
       #COLOUR=yellow
    fi
    $BB $BBDISP "status $UPSNAME.ups $COLOUR $DATE $(cat $OUT.final)"
    rm $OUT.final
done
 
--- snip ---
 
 
*From:* user-9219fb9415b1@xymon.invalid
[mailto:user-9219fb9415b1@xymon.invalid]
*Sent:* Thursday, 10 September 2009 2:18 PM
*To:* user-ae9b8668bcde@xymon.invalid
*Subject:* [hobbit] Antwort: RE: [hobbit] UPS monitoring using devmon


Hi Craig,
hi David,

sounds very nice.

I tried that snmpwalk. It only works with snmp V1. This is the output:

SNMPv2-SMI::mib-2.33.1.1.1.0 = STRING: "MGE UPS SYSTEMS"
SNMPv2-SMI::mib-2.33.1.1.2.0 = STRING: "Galaxy PW Single//"
SNMPv2-SMI::mib-2.33.1.1.3.0 = ""
SNMPv2-SMI::mib-2.33.1.1.4.0 = STRING: "GB (SN 49EE49044)"
SNMPv2-SMI::mib-2.33.1.1.5.0 = ""
SNMPv2-SMI::mib-2.33.1.1.6.0 = ""

As I see it, this is only the description of the UPS. I will look for
the MIB of my devices.
Don't know where all the other things which I want to monitor at
minimum are located in the MIB like:

Overall status or am I runnung on battery
output power
remaining battery time
temperature
I'll look at uploading it to the SF repository.
Maybe this is a stupid question, but I don't find templates and things
on the SF page. Only devmon itself.
I look at http://devmon.sourceforge.net/ and at
http://sourceforge.net/projects/devmon/
There is a devmon-template file there, but as I see it, it contains
only the templates which are delivered with devmon itself.

It would be nice if you share your templates. You can also contact me
via user-674624a37c09@xymon.invalid at daimler dot com

Thank you very much

Thorsten

Craig

-----Original Message-----
From: David Baldwin [mailto:user-cbbf693f2c89@xymon.invalid]
Sent: Thursday, 10 September 2009 11:53 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] UPS monitoring using devmon

user-9219fb9415b1@xymon.invalid wrote:
Hi,

sorry if this a little offtopic, but maybe someone has a devmon
template for the following UPS:

Emerson/Liebert HiPulse MM
MGE Galaxy Single
MGE Upsilon STS_100 Cross switch
MGE Upsilon STS_20 Cross switch

Thank you
Thorsten


If you are not the intended addressee, please inform us
immediately
that you have received this e-mail in error, and delete it. We
thank
you for your cooperation.
I have a template for the standard UPS MIB which I could send
through. I
have a little more work to do on it splitting the power status
into 3
tests for input, output and battery. Should give me motivation to
complete this today and I will upload to devmon SF site.

You can check if your UPS supports the standard UPS MIB or wants a
proprietary one (substituting for myups below, and your
community string
if it is not "public"):

snmpwalk -v2c -cpublic myups 1.3.6.1.2.1.33.1.1

Note that some UPS devices only support SNMPv1, so try -v1
instead of
-v2c above if it doesn't work.

David.

--
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT
2617

Keep up to date with what's happening in Australian sport visit
http://www.ausport.gov.au

This message is intended for the addressee named and may contain
confidential and privileged information. If you are not the intended
recipient please note that any form of distribution, copying or
use of
this communication or the information in it is strictly
prohibited and
may be unlawful. If you receive this message in error, please
delete it
and notify the sender.


DISCLAIMER:
 

The information contained in this email message is confidential and
for the attention of the intended recipient only.
It is not necessarily the official view or communication of the
Rodney District Council.
If you are not the intended recipient you must not disclose, copy or
distribute this message or the information in it.
If you have received this message in error, please delete or destroy
all copies of the email and notify the sender immediately.
Rodney District Council  accepts no responsibility for any effects
this email message or attachments has on the recipient network or
computer system.

If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.

NOTICE: This email and any attachments are confidential.
They may contain legally privileged information or
copyright material. You must not read, copy, use or
disclose them without authorisation. If you are not an
intended recipient, please contact us at once by return
email and then delete both messages and all attachments.
 
NOTICE: This email and any attachments are confidential.
They may contain legally privileged information or
copyright material. You must not read, copy, use or
disclose them without authorisation. If you are not an
intended recipient, please contact us at once by return
email and then delete both messages and all attachments.
 
--
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617

If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.
-- 
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617
list Thorsten Erdmann · Fri, 11 Sep 2009 10:56:00 +0200 ·
Hi David

I just tested your template against my MGE Galaxy. There are some minor 
issues:

1.  battery voltage is displayed as 42100V, yeah. I solved that with 
setting the transform of "upsBatteryVoltageTxt" to "{upsBatteryVoltage} / 
10" instead of "x 10"
2.  battery current is 0A, it seems that the MGE does not deliver this 
value
3.  message test is yellow: "primary OID upsAlarmDescrTxt in table is a 
non-repeater", I don't know how to solve that
4.  output power is 0kW. If I use the special MGE MIB I get real results
5.  input power displays unrealistic results:
         Line bads: 3
         Input configuration: 3 lines of 0 V AC @ 0.0 Hz

         UPS Input
         Phase Freq Volts Amps Power 
        1 50.0 Hz  390V 28.0A 2746W 
        2 50.0 Hz  395V 28.0A 2835W 
        3 50.0 Hz  391V 28.0A 2765W 
6.  I am missing some temperature tests

So now I am unsure what to do.
I can ignore these issues
I can modify your template to use the OIDs of the vendor's MIB
I can use my own template which does not display so much results, but uses 
the vendor's MIB

It seems that the vendors does not support the standard UPS MIB very 
cleanly. So I think we have to build a special template for every vendor. 
:-(

But even if I don't use your template it was very helpful. It is a very 
good demonstration how to use tables and other stuff in devmon. I didn't 
try the graphing now, but I will do it now. :-)

Thank you for your work!!!

Thorsten

user-cbbf693f2c89@xymon.invalid schrieb am 11.09.2009 07:26:30:
quoted from David Baldwin
My UPS template has been tweaked and is now available from the devmon SF
repository:

http://devmon.svn.sourceforge.net/viewvc/devmon/trunk/templates/ups.
tar.gz?view=tar
quoted from David Baldwin

README file includes hobbitgraph.cfg section and info on setting up RRD
collection and graphing.

Let me know if any problems. The msgs test attempts to show the
AlarmDesc repeater which is empty unless there are any alarms which may
cause issues - I've increased the number of "not found" repeaters
slightly in my copy of devmon to be more lenient. The line is in
modules/dm_snmp.pm

  if($failed_query > 2) {

I increased 2 to 6.

your example was very helpfull. I now managed to get a working devmon
template for my MGE UPS. Only graphing isn't working now.

BTW.: anyone knows how I can format output numbers in devmon. I now
get the voltages with two digits behind the colon, but these are
always zero. So I want to omit these digits at all.
The number of decimal digits displayed is controlled in the transforms
file with MATH operator by adding ": N" - e.g.

upsInputCurrentA      : MATH  : {upsInputCurrent} / 10 : 1

will display for example 10.1 - change to ": 0" to get 10

David.
Thorsten Erdmann


user-cbbf693f2c89@xymon.invalid schrieb am 10.09.2009 09:51:49:
Sorry all, didn't get time today to update the UPS template today.

It has separate graphs for input voltage, output phase voltages, 
battery
levels and separate tests/alerting on various conditions - input
voltage=0, battery time remaining <15 mins, output phase overload, 
etc.

David.
Oops, forgot to add the graphing bit.

Usual stuff.
In hobbitserver.cfg
Add "ups=ncv" to TEST2RRD=
Add "ups" to GRAPHS=
Add line NCV_ups="Load:GAUGE,Charge:GAUGE"

Add this to hobbitgraph.cfg
[ups]
        TITLE UPS Charge
        YAXIS Power
        -u 100
        -l 0
        DEF:u=ups.rrd:Charge:AVERAGE
        DEF:p=ups.rrd:Load:AVERAGE
        LINE2:u#00CC00:Charge
        LINE2:p#0000FF:Load
        COMMENT:\n
        GPRINT:u:LAST:Charge   \: %5.1lf%s (cur)
        GPRINT:u:MAX: \: %5.1lf%s (max)
        GPRINT:u:MIN: \: %5.1lf%s (min)
        GPRINT:u:AVERAGE: \: %5.1lf%s (avg)\n
        GPRINT:p:LAST:Load   \: %5.1lf%s (cur)
        GPRINT:p:MAX: \: %5.1lf%s (max)
        GPRINT:p:MIN: \: %5.1lf%s (min)
        GPRINT:p:AVERAGE: \: %5.1lf%s (avg)\n
Cheers
     Vernon


*From:* Everett, Vernon [mailto:user-9da1a1882f49@xymon.invalid]
*Sent:* Thursday, 10 September 2009 2:50 PM
*To:* 'user-ae9b8668bcde@xymon.invalid'
*Subject:* RE: [hobbit] Antwort: RE: [hobbit] UPS monitoring using
devmon

I wrote this a while back for our MGEs.
As you can see, it predates my introduction to devmon and 
indicates a
complete lack of understanding of SNMP.
That being said, the code and the MIBs might give you a good
indication of where to start.
(Either that, or you can just use it as "good enough")
This was designed to run on the hobbit/xymon server.

I have been meaning to rewrite this, or move it to devmon, but 
just
haven't had the time.
(And it's doing an adequate job for now.)

Cheers
      V

bb-host entries look like this
1.2.3.4     galaxy3000    # http://1.2.3.4/ups_prop.htm ups 
galaxy3000
COMMENT:"Meaningful Comment if required"
2.3.4.5   Karratha_UPS    # http://2.3.4.5/ups_prop.htm ups 
galaxy3000
COMMENT:"Insert Comment"


--- snip---

cat ups.ksh
#!/bin/ksh
DATE=$(date)
#set -x
SPACER=" 
"
BBTMP=/tmp
#BBHOSTS=/etc/hobbit/bb-hosts
#OUT=$BBTMP/upspage
BBHOSTLIST="$BBHOSTS $(grep ^include $BBHOSTS | awk '{ print $2 
}')" #
Make sure we read the include files too
#grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include"
grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include" | while 
read
IP UPSNAME HASH URL UPS TYPE OTHER
do
   echo $IP $UPSNAME
   ping -c1 $IP > /dev/null
   if [ $? -eq 0 ]
   then
      COLOUR=green
      case $TYPE in
         galaxy3000)
$OUT.warn
$OUT.tmp
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-SMI::mib-2.33.1.1.1.0)
            DEVICE=${TEMP##*:}       # String
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-SMI::mib-2.33.1.1.2.0)
            MODEL=${TEMP##*:}        # String
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-MIB::sysLocation.0)
            LOCATION=${TEMP##*:}             # String
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-SMI::mib-2.33.1.1.4.0)
            SERIAL=${TEMP##*:}               # String
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.4.8.0)
            LOWBATTERY=${TEMP##*:}           # Integer % Point at
which shutdown triggered
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.5.1.0)
            TIME_REMAIN=${TEMP##*:}     # Integer seconds
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.5.2.0)
            BATTERY_LEVEL=${TEMP##*:}   # Integer %
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.5.9.0)
            BATTERY_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.5.11.0)
            BATTERY_REPLACE=${TEMP##*:} # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.5.15.0)
            CHARGER_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.3.0)
            OUT_ON_BAT=${TEMP##*:}      # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.4.0)
            OUT_ON_BYPASS=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.10.0)
            OUT_OVERLOAD=${TEMP##*:}    # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.10.0)
            COMMSOK=${TEMP##*:}         # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.6.1.0)
            INPHASES=${TEMP##*:}        # Integer 1 or 3

            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.6.2.1.2)
            INVOLT=${TEMP##*:}          # Integer 10ths of a volt

            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.6.2.1.3)
            INFREQ=${TEMP##*:}          # Integer 10ths of a Hertz

            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.6.2.1.6)
            INAMPS=${TEMP##*:}          # Integer 10ths of an Amp

            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.6.3.0)
            INOK=${TEMP##*:}            # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.6.4.0)
            INFAILCAUSE=${TEMP##*:}     # Integer 1=no fault
                                     #         2=bad voltage
                                     #         3=bad frequency
                                     #         4=no voltage
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.1.0)
            OUTPHASES=${TEMP##*:}       # Integer 1 or 3
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.2)
            OUTVOLT=${TEMP##*:}         # Integer 10ths of a volt
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.3)
            OUTFREQ=${TEMP##*:}         # Integer 10ths of a Hertz
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.4)
            OUTLOAD=${TEMP##*:}         # Integer %
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.5)
            OUTAMPS=${TEMP##*:}         # Integer 10ths of an Amp
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.11.0)
            OVERTEMP=${TEMP##*:}        # Integer 1=yes 2=no
            echo "Manufacturer                          "$DEVICE | 
sed
's/"//g' >> $OUT.tmp
            echo "Model                                "$MODEL | 
sed
's/"//g' >> $OUT.tmp
            echo "Serial Number                        "$SERIAL | 
sed
's/"//g' >> $OUT.tmp
            echo "Location                             "$LOCATION 
|
sed 's/"//g' >> $OUT.tmp
            echo >> $OUT.tmp
            #$LOWBATTERY
            #WARN=""
            #[ -z "$TIME_REMAIN" ] && TIME_REMAIN=0
            #[ $TIME_REMAIN -lt 1200 -a "$COLOUR" != "red" ] &&
COLOUR=yellow
            #[ $TIME_REMAIN -lt 1200 ] && WARN="Time Remaining 
low"
            #[ $TIME_REMAIN -lt 600 ] && COLOUR=red
            #[ $TIME_REMAIN -lt 600 ] && WARN="Time Remaining
critical"
            #[ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            ((s=$TIME_REMAIN%60))
            ((m=$TIME_REMAIN/60))
            echo "Time Remaining                        "$m 
Minutes $s
Seconds >> $OUT.tmp
            WARN=""
            [ -z "$BATTERY_LEVEL" ] && BATTERY_LEVEL=0
            [ $BATTERY_LEVEL -lt 95 -a "$COLOUR" != "red" ] &&
COLOUR=yellow
            [ $BATTERY_LEVEL -lt 95 ] && WARN="Battery level low"
            [ $BATTERY_LEVEL -lt 50 ] && COLOUR=red
            [ $BATTERY_LEVEL -lt 50 ] && WARN="Battery level 
critical"
            [ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            echo "Battery Level "$BATTERY_LEVEL
% >> $OUT.tmp
            BATTERY_LEVEL=$(echo $BATTERY_LEVEL | sed 's/[ 
\t]*//')
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BF=Yes
               COLOUR=red
               echo "Battery Fault!" >> $OUT.warn
            else
               BF=No
            fi
            echo "Battery Fault                         "$BF >>
$OUT.tmp
            if [ $BATTERY_REPLACE -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            echo "Replace Battery                       "$BR >>
$OUT.tmp
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            if [ $CHARGER_FAULT -eq 1 ]
            then
               CF=Yes
               COLOUR=red
               echo "Charger Fault" >> $OUT.warn
            else
               CF=No
            fi
            echo "Charger Fault                         "$CF >>
$OUT.tmp
            if [ $OUT_ON_BAT -eq 1 ]
            then
               OUT_ON_BAT=Yes
               COLOUR=red
               echo "UPS running on battery" >> $OUT.warn
            else
               OUT_ON_BAT=No
            fi
            echo "On Battery "$OUT_ON_BAT
$OUT.tmp
            if [ $OUT_ON_BYPASS -eq 1 ]
            then
               OUT_ON_BYPASS=Yes
               COLOUR=red
               echo "UPS on power bypass" >> $OUT.warn
            else
               OUT_ON_BYPASS=No
            fi
            echo "On Bypass 
"$OUT_ON_BYPASS >> $OUT.tmp
            if [ $OUT_OVERLOAD -eq 1 ]
            then
               OUT_OVERLOAD=Yes
               COLOUR=red
               echo "UPS output overload" >> $OUT.warn
            else
               OUT_OVERLOAD=No
            fi
            echo "Battery Overload "$OUT_OVERLOAD
$OUT.tmp
            if [ $OVERTEMP -eq 1 ]
            then
               OVERTEMP=Yes
               COLOUR=red
               echo "Unit overheating" >> $OUT.warn
            else
               OVERTEMP=No
            fi
            echo "Unit Overheating                      "$OVERTEMP 
$OUT.tmp
            #if [ $COMMSOK -eq 2 ]
            #then
            #   COMMSOK=No
            #   COLOUR=red
            #   echo "No comms from device" >> $OUT.warn
            #else
            #   COMMSOK=Yes
            #fi
            #echo "Comms OK                              "$COMMSOK 
$OUT.tmp
            echo >> $OUT.tmp
            echo "Input Phases                         "$INPHASES 
$OUT.tmp
            INVOLT=$(echo "scale=1 ; $INVOLT/10" | bc)
            echo "Input Voltage                         "$INVOLT 
$OUT.tmp
            INFREQ=$(echo "scale=1 ; $INFREQ/10" | bc)
            echo "Input Frequency                       "$INFREQ 
$OUT.tmp
            INAMPS=$(echo "scale=1 ; $INAMPS/10" | bc)
            echo "Input Current                         "$INAMPS 
$OUT.tmp
            if [ $INOK -eq 1 ]
            then
               # A silly case of reverse logic applies here
               INOK=No
               COLOUR=red
               echo "Power input outside tollerance" >> $OUT.warn
            else
               INOK=Yes
            fi
            echo "Input OK                              "$INOK >>
$OUT.tmp
            [ $INFAILCAUSE -eq 1 ] && FAILCAUSE="No failures"
            [ $INFAILCAUSE -eq 2 ] && FAILCAUSE="Voltage out of
tollearance"
            [ $INFAILCAUSE -eq 3 ] && FAILCAUSE="Frequency out of
tollernace"
            [ $INFAILCAUSE -eq 4 ] && FAILCAUSE="No voltage -
power fail"
            echo "Cause of Failure "$FAILCAUSE >>
$OUT.tmp
            echo >> $OUT.tmp
            echo "Output Phases                        "$OUTPHASES 
$OUT.tmp
            OUTVOLT=$(echo "scale=1 ; $OUTVOLT/10" | bc)
            echo "Output Voltage                        "$OUTVOLT 
$OUT.tmp
            OUTFREQ=$(echo "scale=1 ; $OUTFREQ/10" | bc)
            echo "Output Frequency                      "$OUTFREQ 
$OUT.tmp
            OUTAMPS=$(echo "scale=1 ; $OUTAMPS/10" | bc)
            echo "Output Current                        "$OUTAMPS 
$OUT.tmp
            OUTLOAD=$(echo $OUTLOAD | sed 's/[ \t]*//')
            echo "Output Load                           "$OUTLOAD 
% >>
$OUT.tmp
            echo >> $OUT.final
            cat $OUT.warn >> $OUT.final
            cat $OUT.tmp >> $OUT.final
            echo '<FONT COLOR="Black">' >> $OUT.final
            echo "Load=$OUTLOAD" >> $OUT.final
            echo "Charge=$BATTERY_LEVEL" >> $OUT.final
            echo '</FONT>' >> $OUT.final
            rm $OUT.tmp
            rm $OUT.warn
       esac
    else
       echo "Device Unreachable!" >> $OUT.final
       #COLOUR=yellow
    fi
    $BB $BBDISP "status $UPSNAME.ups $COLOUR $DATE $(cat 
$OUT.final)"
    rm $OUT.final
done

--- snip ---


*From:* user-9219fb9415b1@xymon.invalid
[mailto:user-9219fb9415b1@xymon.invalid]
*Sent:* Thursday, 10 September 2009 2:18 PM
*To:* user-ae9b8668bcde@xymon.invalid
*Subject:* [hobbit] Antwort: RE: [hobbit] UPS monitoring using 
devmon


Hi Craig,
hi David,

sounds very nice.

I tried that snmpwalk. It only works with snmp V1. This is the 
output:

SNMPv2-SMI::mib-2.33.1.1.1.0 = STRING: "MGE UPS SYSTEMS"
SNMPv2-SMI::mib-2.33.1.1.2.0 = STRING: "Galaxy PW Single//"
SNMPv2-SMI::mib-2.33.1.1.3.0 = ""
SNMPv2-SMI::mib-2.33.1.1.4.0 = STRING: "GB (SN 49EE49044)"
SNMPv2-SMI::mib-2.33.1.1.5.0 = ""
SNMPv2-SMI::mib-2.33.1.1.6.0 = ""

As I see it, this is only the description of the UPS. I will look 
for
the MIB of my devices.
Don't know where all the other things which I want to monitor at
minimum are located in the MIB like:

Overall status or am I runnung on battery
output power
remaining battery time
temperature
I'll look at uploading it to the SF repository.
Maybe this is a stupid question, but I don't find templates and 
things
on the SF page. Only devmon itself.
I look at http://devmon.sourceforge.net/ and at
http://sourceforge.net/projects/devmon/
There is a devmon-template file there, but as I see it, it 
contains
only the templates which are delivered with devmon itself.

It would be nice if you share your templates. You can also contact 
me
via user-674624a37c09@xymon.invalid at daimler dot com

Thank you very much

Thorsten

Craig

-----Original Message-----
From: David Baldwin [mailto:user-cbbf693f2c89@xymon.invalid]
Sent: Thursday, 10 September 2009 11:53 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] UPS monitoring using devmon

user-9219fb9415b1@xymon.invalid wrote:
Hi,

sorry if this a little offtopic, but maybe someone has a 
devmon
template for the following UPS:

Emerson/Liebert HiPulse MM
MGE Galaxy Single
MGE Upsilon STS_100 Cross switch
MGE Upsilon STS_20 Cross switch

Thank you
Thorsten


If you are not the intended addressee, please inform us
immediately
that you have received this e-mail in error, and delete it. We
thank
you for your cooperation.
I have a template for the standard UPS MIB which I could send
through. I
have a little more work to do on it splitting the power status
into 3
tests for input, output and battery. Should give me motivation 
to
complete this today and I will upload to devmon SF site.

You can check if your UPS supports the standard UPS MIB or wants 
a
proprietary one (substituting for myups below, and your
community string
if it is not "public"):

snmpwalk -v2c -cpublic myups 1.3.6.1.2.1.33.1.1

Note that some UPS devices only support SNMPv1, so try -v1
instead of
-v2c above if it doesn't work.

David.

--
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 
2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT
2617

Keep up to date with what's happening in Australian sport visit
http://www.ausport.gov.au

This message is intended for the addressee named and may contain
confidential and privileged information. If you are not the 
intended
recipient please note that any form of distribution, copying or
use of
this communication or the information in it is strictly
prohibited and
may be unlawful. If you receive this message in error, please
delete it
and notify the sender.
DISCLAIMER:


The information contained in this email message is confidential 
and
for the attention of the intended recipient only.
It is not necessarily the official view or communication of the
Rodney District Council.
If you are not the intended recipient you must not disclose, 
copy or
distribute this message or the information in it.
If you have received this message in error, please delete or 
destroy
all copies of the email and notify the sender immediately.
Rodney District Council  accepts no responsibility for any 
effects
this email message or attachments has on the recipient network 
or
computer system.

If you are not the intended addressee, please inform us 
immediately
that you have received this e-mail in error, and delete it. We 
thank
you for your cooperation.

NOTICE: This email and any attachments are confidential.
They may contain legally privileged information or
copyright material. You must not read, copy, use or
disclose them without authorisation. If you are not an
intended recipient, please contact us at once by return
email and then delete both messages and all attachments.

NOTICE: This email and any attachments are confidential.
They may contain legally privileged information or
copyright material. You must not read, copy, use or
disclose them without authorisation. If you are not an
intended recipient, please contact us at once by return
email and then delete both messages and all attachments.
--
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 
2617
If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.
-- 
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617

If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Thorsten Erdmann · Fri, 11 Sep 2009 11:31:43 +0200 ·
Hi

I just saw that in all of my Hobbit's directories all datafiles (histlogs, 
rrd files, etc) are doubled. One with capitals and one without:

...
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v004
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 15:39 S068V004
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v010
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V010
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v011
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V011
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v012
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V012
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v013
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V013
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s68tts06
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S68TTS06
...

It seems that somebody "cleaned" the bb-hosts file on Aug 7. So how can I 
delete all that capital files. Because there are several hundreds of hosts 
it is difficult to do by hand. If I simply delete all files I loose all 
the history info. It's bad enough that I loose the history before Aug 7, 
but don't know a way to merge the files.

Maybe I should do a find to all files older than Aug 7?

Any ideas?
quoted from Thorsten Erdmann

Thorsten Erdmann


If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Martin Flemming · Fri, 11 Sep 2009 11:40:31 +0200 (CEST) ·
Hi !

try trimmhistory .. and search in the archive for it ...

or try this
i use the very nice bbdataclean.pl script by Eric Schwimmer . :-)

http://nerdvana.org/eric/bbtools/
cheers,
 	martin
quoted from Thorsten Erdmann

On Fri, 11 Sep 2009, user-9219fb9415b1@xymon.invalid wrote:
Hi

I just saw that in all of my Hobbit's directories all datafiles (histlogs,
rrd files, etc) are doubled. One with capitals and one without:

...
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v004
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 15:39 S068V004
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v010
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V010
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v011
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V011
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v012
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V012
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v013
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V013
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s68tts06
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S68TTS06
...

It seems that somebody "cleaned" the bb-hosts file on Aug 7. So how can I
delete all that capital files. Because there are several hundreds of hosts
it is difficult to do by hand. If I simply delete all files I loose all
the history info. It's bad enough that I loose the history before Aug 7,
but don't know a way to merge the files.

Maybe I should do a find to all files older than Aug 7?

Any ideas?

Thorsten Erdmann


If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Rolf Schrittenlocher · Fri, 11 Sep 2009 13:47:16 +0200 ·
Hi,

on UNIX (solaris, others may work)
try for testing
find . -name S\* -exec ls -l {} \;
for real delete
find . -name S\* -exec rm -f {} \;

kind regards
Rolf
quoted from Martin Flemming
Hi

I just saw that in all of my Hobbit's directories all datafiles 
(histlogs, rrd files, etc) are doubled. One with capitals and one without:

...
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v004
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 15:39 S068V004
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v010
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V010
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v011
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V011
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v012
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V012
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s068v013
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S068V013
drwxr-xr-x   2 hobbit nobody 1024 Aug  7 11:05 s68tts06
drwxr-xr-x   2 hobbit nobody 1024 Aug  6 13:03 S68TTS06
...

It seems that somebody "cleaned" the bb-hosts file on Aug 7. So how 
can I delete all that capital files. Because there are several 
hundreds of hosts it is difficult to do by hand. If I simply delete 
all files I loose all the history info. It's bad enough that I loose 
the history before Aug 7, but don't know a way to merge the files.

Maybe I should do a find to all files older than Aug 7?

Any ideas?

Thorsten Erdmann

If you are not the intended addressee, please inform us immediately 
that you have received this e-mail in error, and delete it. We thank 
you for your cooperation.
-- 

Mit freundlichen Gruessen
Rolf Schrittenlocher

HeBIS-IT, Senckenberganlage 31, 60054 Frankfurt
Tel: (XX) XX - XXX XXXXX   Fax: (XX) XX XXX XXXXX
LBS: user-1e39a1813094@xymon.invalid
Persoenlich: user-ea9d95bffcf0@xymon.invalid
list David Baldwin · Mon, 14 Sep 2009 16:41:01 +1000 ·
quoted from Thorsten Erdmann
user-9219fb9415b1@xymon.invalid wrote:
Hi David

I just tested your template against my MGE Galaxy. There are some 
minor issues:
I developed it against a Chloride UPS.
quoted from Thorsten Erdmann
1.  battery voltage is displayed as 42100V, yeah. I solved that with 
setting the transform of "upsBatteryVoltageTxt" to 
"{upsBatteryVoltage} / 10" instead of "x 10"
Whoops - my bad. My UPS shows:
UPS-MIB::upsBatteryVoltage.0 (.1.3.6.1.2.1.33.1.2.5.0) = INTEGER: 22 0.1 
Volt DC
So that's really 2.2V not 220V.
quoted from Thorsten Erdmann
2.  battery current is 0A, it seems that the MGE does not deliver this 
value
Likewise, my UPS does not return anything other than 0. We just had a 
power failure and it didn't even move from 0 during that, so it's not 
drain on the batteries when in use. It was really there for completeness.
quoted from Thorsten Erdmann
3.  message test is yellow: "primary OID upsAlarmDescrTxt in table is 
a non-repeater", I don't know how to solve that
Rest assured, when there IS an alarm, you will see them - I had 2 this 
morning.

At the moment devmon doesn't handle empty repeaters well. I had some 
discussions with Buchan a while ago.
4.  output power is 0kW. If I use the special MGE MIB I get real results
I do get real values on output power (but not on input power).
quoted from Thorsten Erdmann
5.  input power displays unrealistic results:
         Line bads: 3
         Input configuration: 3 lines of 0 V AC @ 0.0 Hz
These depend on config values. They may need to be populated in the UPS 
management interface - I'm not sure. I do get them returned for my UPS.
quoted from Thorsten Erdmann
         UPS Input
         Phase Freq Volts Amps Power
        1 50.0 Hz  390V 28.0A 2746W
        2 50.0 Hz  395V 28.0A 2835W
        3 50.0 Hz  391V 28.0A 2765W
6.  I am missing some temperature tests

So now I am unsure what to do.
I can ignore these issues
I can modify your template to use the OIDs of the vendor's MIB
I can use my own template which does not display so much results, but 
uses the vendor's MIB
I've had similar dilemmas with HP servers with all kinds of mixes of 
hardware RAID controllers, hardware event logs and then adding 
SNMP-Informant on the top.
quoted from Thorsten Erdmann
It seems that the vendors does not support the standard UPS MIB very 
cleanly. So I think we have to build a special template for every 
vendor. :-(

But even if I don't use your template it was very helpful. It is a 
very good demonstration how to use tables and other stuff in devmon. I 
didn't try the graphing now, but I will do it now. :-)
Let me know how you go with that.
Thank you for your work!!!
Thanks.

I just added "templatebuilder.pl" into the extras directory in the 
devmon SVN repository.

It gives a good start on putting together a template, translating 
between names and OIDs, generating barebones oids, transforms and 
thresholds files.

It relies on having the MIB definition files installed correctly.

David.
quoted from Thorsten Erdmann
Thorsten

user-cbbf693f2c89@xymon.invalid schrieb am 11.09.2009 07:26:30:
My UPS template has been tweaked and is now available from the devmon SF
repository:
http://devmon.svn.sourceforge.net/viewvc/devmon/trunk/templates/ups.
tar.gz?view=tar

README file includes hobbitgraph.cfg section and info on setting up RRD
collection and graphing.

Let me know if any problems. The msgs test attempts to show the
AlarmDesc repeater which is empty unless there are any alarms which may
cause issues - I've increased the number of "not found" repeaters
slightly in my copy of devmon to be more lenient. The line is in
modules/dm_snmp.pm

  if($failed_query > 2) {

I increased 2 to 6.

your example was very helpfull. I now managed to get a working devmon
template for my MGE UPS. Only graphing isn't working now.

BTW.: anyone knows how I can format output numbers in devmon. I now
get the voltages with two digits behind the colon, but these are
always zero. So I want to omit these digits at all.
The number of decimal digits displayed is controlled in the transforms
file with MATH operator by adding ": N" - e.g.

upsInputCurrentA      : MATH  : {upsInputCurrent} / 10 : 1

will display for example 10.1 - change to ": 0" to get 10

David.
Thorsten Erdmann


user-cbbf693f2c89@xymon.invalid schrieb am 10.09.2009 09:51:49:
Sorry all, didn't get time today to update the UPS template today.

It has separate graphs for input voltage, output phase voltages, 
battery
levels and separate tests/alerting on various conditions - input
voltage=0, battery time remaining <15 mins, output phase 
overload, etc.

David.
Oops, forgot to add the graphing bit.
 
Usual stuff.
In hobbitserver.cfg
Add "ups=ncv" to TEST2RRD=
Add "ups" to GRAPHS=
Add line NCV_ups="Load:GAUGE,Charge:GAUGE"
 
Add this to hobbitgraph.cfg
[ups]
        TITLE UPS Charge
        YAXIS Power
        -u 100
        -l 0
        DEF:u=ups.rrd:Charge:AVERAGE
        DEF:p=ups.rrd:Load:AVERAGE
        LINE2:u#00CC00:Charge
        LINE2:p#0000FF:Load
        COMMENT:\n
        GPRINT:u:LAST:Charge   \: %5.1lf%s (cur)
        GPRINT:u:MAX: \: %5.1lf%s (max)
        GPRINT:u:MIN: \: %5.1lf%s (min)
        GPRINT:u:AVERAGE: \: %5.1lf%s (avg)\n
        GPRINT:p:LAST:Load   \: %5.1lf%s (cur)
        GPRINT:p:MAX: \: %5.1lf%s (max)
        GPRINT:p:MIN: \: %5.1lf%s (min)
        GPRINT:p:AVERAGE: \: %5.1lf%s (avg)\n
Cheers
     Vernon
 
 
*From:* Everett, Vernon [mailto:user-9da1a1882f49@xymon.invalid]
*Sent:* Thursday, 10 September 2009 2:50 PM
*To:* 'user-ae9b8668bcde@xymon.invalid'
*Subject:* RE: [hobbit] Antwort: RE: [hobbit] UPS monitoring using
devmon

I wrote this a while back for our MGEs.
As you can see, it predates my introduction to devmon and 
indicates a
complete lack of understanding of SNMP.
That being said, the code and the MIBs might give you a good
indication of where to start.
(Either that, or you can just use it as "good enough")
This was designed to run on the hobbit/xymon server.
 
I have been meaning to rewrite this, or move it to devmon, but 
just
haven't had the time.
(And it's doing an adequate job for now.)
 
Cheers
      V
 
bb-host entries look like this
1.2.3.4     galaxy3000    # http://1.2.3.4/ups_prop.htm ups 
galaxy3000
COMMENT:"Meaningful Comment if required"
2.3.4.5   Karratha_UPS    # http://2.3.4.5/ups_prop.htm ups 
galaxy3000
COMMENT:"Insert Comment"

 
--- snip---
 
cat ups.ksh
#!/bin/ksh
DATE=$(date)
#set -x
SPACER="                                                          
       
"
BBTMP=/tmp
#BBHOSTS=/etc/hobbit/bb-hosts
#OUT=$BBTMP/upspage
BBHOSTLIST="$BBHOSTS $(grep ^include $BBHOSTS | awk '{ print 
$2 }')" #
Make sure we read the include files too
#grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include"
grep -h " ups " $BBHOSTLIST | egrep -v "^page|^include" | 
while read
IP UPSNAME HASH URL UPS TYPE OTHER
do
   echo $IP $UPSNAME
   ping -c1 $IP > /dev/null
   if [ $? -eq 0 ]
   then
      COLOUR=green
      case $TYPE in
         galaxy3000)
$OUT.warn
$OUT.tmp
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-SMI::mib-2.33.1.1.1.0)
            DEVICE=${TEMP##*:}       # String
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-SMI::mib-2.33.1.1.2.0)
            MODEL=${TEMP##*:}        # String
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-MIB::sysLocation.0)
            LOCATION=${TEMP##*:}             # String
            TEMP=$(snmpget -v1 -c public $IP
SNMPv2-SMI::mib-2.33.1.1.4.0)
            SERIAL=${TEMP##*:}               # String
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.4.8.0)
            LOWBATTERY=${TEMP##*:}           # Integer % Point at
which shutdown triggered
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.5.1.0)
            TIME_REMAIN=${TEMP##*:}     # Integer seconds
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.5.2.0)
            BATTERY_LEVEL=${TEMP##*:}   # Integer %
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.5.9.0)
            BATTERY_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.5.11.0)
            BATTERY_REPLACE=${TEMP##*:} # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.5.15.0)
            CHARGER_FAULT=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.3.0)
            OUT_ON_BAT=${TEMP##*:}      # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.4.0)
            OUT_ON_BYPASS=${TEMP##*:}   # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.10.0)
            OUT_OVERLOAD=${TEMP##*:}    # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.10.0)
            COMMSOK=${TEMP##*:}         # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.6.1.0)
            INPHASES=${TEMP##*:}        # Integer 1 or 3
 
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.6.2.1.2)
            INVOLT=${TEMP##*:}          # Integer 10ths of a volt
 
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.6.2.1.3)
            INFREQ=${TEMP##*:}          # Integer 10ths of a Hertz
 
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.6.2.1.6)
            INAMPS=${TEMP##*:}          # Integer 10ths of an Amp
 
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.6.3.0)
            INOK=${TEMP##*:}            # Integer 1=yes 2=no
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.6.4.0)
            INFAILCAUSE=${TEMP##*:}     # Integer 1=no fault
                                     #         2=bad voltage
                                     #         3=bad frequency
                                     #         4=no voltage
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.1.0)
            OUTPHASES=${TEMP##*:}       # Integer 1 or 3
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.2)
            OUTVOLT=${TEMP##*:}         # Integer 10ths of a volt
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.3)
            OUTFREQ=${TEMP##*:}         # Integer 10ths of a Hertz
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.4)
            OUTLOAD=${TEMP##*:}         # Integer %
            TEMP=$(snmpget -v1 -c public $IP
1.3.6.1.4.1.705.1.7.2.1.5)
            OUTAMPS=${TEMP##*:}         # Integer 10ths of an Amp
            TEMP=$(snmpget -v1 -c public $IP 
1.3.6.1.4.1.705.1.7.11.0)
            OVERTEMP=${TEMP##*:}        # Integer 1=yes 2=no
            echo "Manufacturer                         
 "$DEVICE | sed
's/"//g' >> $OUT.tmp
            echo "Model                                "$MODEL 
| sed
's/"//g' >> $OUT.tmp
            echo "Serial Number                       
 "$SERIAL | sed
's/"//g' >> $OUT.tmp
            echo "Location                             
"$LOCATION |
sed 's/"//g' >> $OUT.tmp
            echo >> $OUT.tmp
            #$LOWBATTERY
            #WARN=""
            #[ -z "$TIME_REMAIN" ] && TIME_REMAIN=0
            #[ $TIME_REMAIN -lt 1200 -a "$COLOUR" != "red" ] &&
COLOUR=yellow
            #[ $TIME_REMAIN -lt 1200 ] && WARN="Time Remaining 
low"
            #[ $TIME_REMAIN -lt 600 ] && COLOUR=red
            #[ $TIME_REMAIN -lt 600 ] && WARN="Time Remaining
critical"
            #[ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            ((s=$TIME_REMAIN%60))
            ((m=$TIME_REMAIN/60))
            echo "Time Remaining                        "$m 
Minutes $s
Seconds >> $OUT.tmp
            WARN=""
            [ -z "$BATTERY_LEVEL" ] && BATTERY_LEVEL=0
            [ $BATTERY_LEVEL -lt 95 -a "$COLOUR" != "red" ] &&
COLOUR=yellow
            [ $BATTERY_LEVEL -lt 95 ] && WARN="Battery level low"
            [ $BATTERY_LEVEL -lt 50 ] && COLOUR=red
            [ $BATTERY_LEVEL -lt 50 ] && WARN="Battery level 
critical"
            [ "$WARN" != "" ] && echo $WARN >> $OUT.warn
            echo "Battery Level                       
 "$BATTERY_LEVEL
% >> $OUT.tmp
            BATTERY_LEVEL=$(echo $BATTERY_LEVEL | sed 's/[ 
\t]*//')
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BF=Yes
               COLOUR=red
               echo "Battery Fault!" >> $OUT.warn
            else
               BF=No
            fi
            echo "Battery Fault                         "$BF >>
$OUT.tmp
            if [ $BATTERY_REPLACE -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            echo "Replace Battery                       "$BR >>
$OUT.tmp
            if [ $BATTERY_FAULT -eq 1 ]
            then
               BR=Yes
               COLOUR=red
               echo "Battery replacement required" >> $OUT.warn
            else
               BR=No
            fi
            if [ $CHARGER_FAULT -eq 1 ]
            then
               CF=Yes
               COLOUR=red
               echo "Charger Fault" >> $OUT.warn
            else
               CF=No
            fi
            echo "Charger Fault                         "$CF >>
$OUT.tmp
            if [ $OUT_ON_BAT -eq 1 ]
            then
               OUT_ON_BAT=Yes
               COLOUR=red
               echo "UPS running on battery" >> $OUT.warn
            else
               OUT_ON_BAT=No
            fi
            echo "On Battery                           
 "$OUT_ON_BAT
$OUT.tmp
            if [ $OUT_ON_BYPASS -eq 1 ]
            then
               OUT_ON_BYPASS=Yes
               COLOUR=red
               echo "UPS on power bypass" >> $OUT.warn
            else
               OUT_ON_BYPASS=No
            fi
            echo "On Bypass                            
"$OUT_ON_BYPASS >> $OUT.tmp
            if [ $OUT_OVERLOAD -eq 1 ]
            then
               OUT_OVERLOAD=Yes
               COLOUR=red
               echo "UPS output overload" >> $OUT.warn
            else
               OUT_OVERLOAD=No
            fi
            echo "Battery Overload                     
 "$OUT_OVERLOAD
$OUT.tmp
            if [ $OVERTEMP -eq 1 ]
            then
               OVERTEMP=Yes
               COLOUR=red
               echo "Unit overheating" >> $OUT.warn
            else
               OVERTEMP=No
            fi
            echo "Unit Overheating                     
 "$OVERTEMP >>
$OUT.tmp
            #if [ $COMMSOK -eq 2 ]
            #then
            #   COMMSOK=No
            #   COLOUR=red
            #   echo "No comms from device" >> $OUT.warn
            #else
            #   COMMSOK=Yes
            #fi
            #echo "Comms OK                             
 "$COMMSOK >>
$OUT.tmp
            echo >> $OUT.tmp
            echo "Input Phases                         
"$INPHASES >>
$OUT.tmp
            INVOLT=$(echo "scale=1 ; $INVOLT/10" | bc)
            echo "Input Voltage                         
"$INVOLT >>
$OUT.tmp
            INFREQ=$(echo "scale=1 ; $INFREQ/10" | bc)
            echo "Input Frequency                       
"$INFREQ >>
$OUT.tmp
            INAMPS=$(echo "scale=1 ; $INAMPS/10" | bc)
            echo "Input Current                         
"$INAMPS >>
$OUT.tmp
            if [ $INOK -eq 1 ]
            then
               # A silly case of reverse logic applies here
               INOK=No
               COLOUR=red
               echo "Power input outside tollerance" >> $OUT.warn
            else
               INOK=Yes
            fi
            echo "Input OK                              "$INOK >>
$OUT.tmp
            [ $INFAILCAUSE -eq 1 ] && FAILCAUSE="No failures"
            [ $INFAILCAUSE -eq 2 ] && FAILCAUSE="Voltage out of
tollearance"
            [ $INFAILCAUSE -eq 3 ] && FAILCAUSE="Frequency out of
tollernace"
            [ $INFAILCAUSE -eq 4 ] && FAILCAUSE="No voltage -
power fail"
            echo "Cause of Failure                     
 "$FAILCAUSE >>
$OUT.tmp
            echo >> $OUT.tmp
            echo "Output Phases                       
 "$OUTPHASES >>
$OUT.tmp
            OUTVOLT=$(echo "scale=1 ; $OUTVOLT/10" | bc)
            echo "Output Voltage                       
 "$OUTVOLT >>
$OUT.tmp
            OUTFREQ=$(echo "scale=1 ; $OUTFREQ/10" | bc)
            echo "Output Frequency                     
 "$OUTFREQ >>
$OUT.tmp
            OUTAMPS=$(echo "scale=1 ; $OUTAMPS/10" | bc)
            echo "Output Current                       
 "$OUTAMPS >>
$OUT.tmp
            OUTLOAD=$(echo $OUTLOAD | sed 's/[ \t]*//')
            echo "Output Load                           
"$OUTLOAD % >>
$OUT.tmp
            echo >> $OUT.final
            cat $OUT.warn >> $OUT.final
            cat $OUT.tmp >> $OUT.final
            echo '<FONT COLOR="Black">' >> $OUT.final
            echo "Load=$OUTLOAD" >> $OUT.final
            echo "Charge=$BATTERY_LEVEL" >> $OUT.final
            echo '</FONT>' >> $OUT.final
            rm $OUT.tmp
            rm $OUT.warn
       esac
    else
       echo "Device Unreachable!" >> $OUT.final
       #COLOUR=yellow
    fi
    $BB $BBDISP "status $UPSNAME.ups $COLOUR $DATE $(cat 
$OUT.final)"
    rm $OUT.final
done
 
--- snip ---
 
 
*From:* user-9219fb9415b1@xymon.invalid
[mailto:user-9219fb9415b1@xymon.invalid]
*Sent:* Thursday, 10 September 2009 2:18 PM
*To:* user-ae9b8668bcde@xymon.invalid
*Subject:* [hobbit] Antwort: RE: [hobbit] UPS monitoring using 
devmon


Hi Craig,
hi David,

sounds very nice.

I tried that snmpwalk. It only works with snmp V1. This is the 
output:

SNMPv2-SMI::mib-2.33.1.1.1.0 = STRING: "MGE UPS SYSTEMS"
SNMPv2-SMI::mib-2.33.1.1.2.0 = STRING: "Galaxy PW Single//"
SNMPv2-SMI::mib-2.33.1.1.3.0 = ""
SNMPv2-SMI::mib-2.33.1.1.4.0 = STRING: "GB (SN 49EE49044)"
SNMPv2-SMI::mib-2.33.1.1.5.0 = ""
SNMPv2-SMI::mib-2.33.1.1.6.0 = ""

As I see it, this is only the description of the UPS. I will 
look for
the MIB of my devices.
Don't know where all the other things which I want to monitor at
minimum are located in the MIB like:

Overall status or am I runnung on battery
output power
remaining battery time
temperature
I'll look at uploading it to the SF repository.
Maybe this is a stupid question, but I don't find templates 
and things
on the SF page. Only devmon itself.
I look at http://devmon.sourceforge.net/ and at
http://sourceforge.net/projects/devmon/
There is a devmon-template file there, but as I see it, it 
contains
only the templates which are delivered with devmon itself.

It would be nice if you share your templates. You can also 
contact me
via user-674624a37c09@xymon.invalid at daimler dot com

Thank you very much

Thorsten

Craig

-----Original Message-----
From: David Baldwin [mailto:user-cbbf693f2c89@xymon.invalid]
Sent: Thursday, 10 September 2009 11:53 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] UPS monitoring using devmon

user-9219fb9415b1@xymon.invalid wrote:
Hi,

sorry if this a little offtopic, but maybe someone has a 
devmon
template for the following UPS:

Emerson/Liebert HiPulse MM
MGE Galaxy Single
MGE Upsilon STS_100 Cross switch
MGE Upsilon STS_20 Cross switch

Thank you
Thorsten


If you are not the intended addressee, please inform us
immediately
that you have received this e-mail in error, and delete it. We
thank
you for your cooperation.
I have a template for the standard UPS MIB which I could send
through. I
have a little more work to do on it splitting the power status
into 3
tests for input, output and battery. Should give me 
motivation to
complete this today and I will upload to devmon SF site.

You can check if your UPS supports the standard UPS MIB or 
wants a
proprietary one (substituting for myups below, and your
community string
if it is not "public"):

snmpwalk -v2c -cpublic myups 1.3.6.1.2.1.33.1.1

Note that some UPS devices only support SNMPv1, so try -v1
instead of
-v2c above if it doesn't work.

David.

--
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen 
ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT
2617

Keep up to date with what's happening in Australian sport visit
http://www.ausport.gov.au

This message is intended for the addressee named and may contain
confidential and privileged information. If you are not the 
intended
recipient please note that any form of distribution, copying or
use of
this communication or the information in it is strictly
prohibited and
may be unlawful. If you receive this message in error, please
delete it
and notify the sender.
DISCLAIMER:
 

The information contained in this email message is 
confidential and
for the attention of the intended recipient only.
It is not necessarily the official view or communication of the
Rodney District Council.
If you are not the intended recipient you must not disclose, 
copy or
distribute this message or the information in it.
If you have received this message in error, please delete or 
destroy
all copies of the email and notify the sender immediately.
Rodney District Council  accepts no responsibility for any 
effects
this email message or attachments has on the recipient 
network or
computer system.

If you are not the intended addressee, please inform us 
immediately
that you have received this e-mail in error, and delete it. We 
thank
you for your cooperation.

NOTICE: This email and any attachments are confidential.
They may contain legally privileged information or
copyright material. You must not read, copy, use or
disclose them without authorisation. If you are not an
intended recipient, please contact us at once by return
email and then delete both messages and all attachments.
 
NOTICE: This email and any attachments are confidential.
They may contain legally privileged information or
copyright material. You must not read, copy, use or
disclose them without authorisation. If you are not an
intended recipient, please contact us at once by return
email and then delete both messages and all attachments.
 
--
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 
2617
If you are not the intended addressee, please inform us immediately
that you have received this e-mail in error, and delete it. We thank
you for your cooperation.
--
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          Leverrier Street Bruce ACT 2617

If you are not the intended addressee, please inform us immediately 
that you have received this e-mail in error, and delete it. We thank 
you for your cooperation.
list Buchan Milne · Tue, 15 Sep 2009 14:28:10 +0200 (SAST) ·
quoted from Thorsten Erdmann
----- "thorsten erdmann" <user-9219fb9415b1@xymon.invalid> wrote:
Hi

I try to get some temperature graphs of my UPS. The UPS test produces
broken numbers like this:
What do you mean by "broken"? Do you mean non-integers?
quoted from Thorsten Erdmann
Temperature status:

Warning level: 35 C
Alarm level : 40 C

Device Temp(C) Temp(F)
Ambient 20.7 69


Devmon version 0.3.1-beta1 running on s068a300


I manged to get the numbers into a graph if I alter the output to not
showing 20.7, instead showing 21.
The graph show up several lines like

Ambient_______20.
Ambient_______21.
I am not sure what you are trying to depict here, are you meaning that the DS names are Ambient______20 ? The output of 'rrdtool info /path/to/temp.rrd |grep ^ds' or similar may help to illustrate more accurately.

Which collector are you using?

Regards,
Buchan
list Buchan Milne · Thu, 17 Sep 2009 12:39:19 +0200 (SAST) ·
quoted from David Baldwin
----- "David Baldwin" <user-cbbf693f2c89@xymon.invalid> wrote:
user-9219fb9415b1@xymon.invalid wrote:
3.  message test is yellow: "primary OID upsAlarmDescrTxt in table
is 
a non-repeater", I don't know how to solve that
Rest assured, when there IS an alarm, you will see them - I had 2 this

morning.

At the moment devmon doesn't handle empty repeaters well. I had some 
discussions with Buchan a while ago.
If this is the usual "many tests go clear when one test uses OIDs not available" issue, I think this patch should be an adequate fix. At least, it allows me to use the linux-netsnmp template (in svn) against my laptop, for which I haven't configured lmsensors, and get data for the working tests without disabling the 'temp' test.

I would appreciate it if someone else could test this change as well, I haven't currently got access to that many affected devices. If it works for someone else, I will commit in svn. It might also be worthwhile logging an issue on the SF tracker.

Regards,
Buchan

(I would also prefer to keep devmon topics on the devmon list ...)

Index: modules/dm_snmp.pm
===================================================================
--- modules/dm_snmp.pm  (revision 150)
+++ modules/dm_snmp.pm  (working copy)
@@ -554,10 +554,12 @@
           my $snmp_err;
        do_log("DEBUG SNMP: $SNMP_Session::errmsg",0) if $g{'debug'};
           ($snmp_err = $SNMP_Session::errmsg) =~ s/\n.*//s;
-          my $error_str =
-            "Error walking $oid for $dev ($snmp_err)";
-          $data_out{'error'}{$error_str} = 0;
-          ++$failed_query;
+         if ($snmp_err ne '') {
+            my $error_str =
+              "Error walking $oid for $dev ($snmp_err)";
+            $data_out{'error'}{$error_str} = 0;
+            ++$failed_query;
+          }
         }
         else {
          # Record our maxrep value for our next poll cycle
list Thorsten Erdmann · Thu, 01 Oct 2009 08:37:05 +0200 ·
First, sorry for the late response, I was on vacation.
What do you mean by "broken"? Do you mean non-integers?
Yes, I mean non integer, e.g.: 22.3 deg or in german notation 22,3 °C
I am not sure what you are trying to depict here, are you meaning that the DS names are Ambient______20 ? The output of 'rrdtool info /path/to/temp.rrd |grep ^ds' or similar may help to illustrate more accurately.
I mean, that the rrd graphs show up a line for each integer that ever has occured. e.g. if I have an output line in the temperture test of

"Ambient    20.5"

I get a line named "Ambient_____20." in the rrd graph with the value 5. So rrd recognizes the string up to the colon as the name and the part after the colon as the value. So if now the temperature changes to 21.2 I get a new line in the rrd graph:

Ambient_____20. with value 5
Ambient_____21. with value 2
Which collector are you using?
I have written the test by myself and it produces an output like the standard temperature test. I therefore use the standard temperature collector.

This output works:


Thu Oct 1 08:30:59 CEST 2009 Temperature Test on webtherm1

Warning level:  28 C
Alarm level  :  30 C

Device                  Temp(C)  Temp(F) -----------------------------------------
green Webtherm1              24       75


This output does not work:


Thu Oct 1 08:30:59 CEST 2009 Temperature Test on webtherm1

Warning level:  28 C
Alarm level  :  30 C

Device                  Temp(C)  Temp(F) -----------------------------------------
green Webtherm1              24.5       75.5
quoted from David Baldwin


If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Thorsten Erdmann · Thu, 01 Oct 2009 08:47:04 +0200 ·
Hi

I have just noticed that devmon stops working if a device it should test is not reachable. We had an UPS test running via devmon an one of the UPS is uninstalled but not deleted in Hobbit/devmon.
When I start devmon it does exactly one scan which reported tons of errors in the devmon log and then nothing happens any more. The Hobbit devmon tests of all devices get purple after some time.

How can I setup devmon to ignore such errors and not stop working.

Thanks
quoted from Thorsten Erdmann
Thorsten


If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
list Buchan Milne · Thu, 1 Oct 2009 23:18:13 +0100 ·
quoted from Thorsten Erdmann
On Thursday, 1 October 2009 07:47:04 user-9219fb9415b1@xymon.invalid wrote:
Hi

I have just noticed that devmon stops working if a device it should test
is not reachable. We had an UPS test running via devmon an one of the UPS
is uninstalled but not deleted in Hobbit/devmon.
When I start devmon it does exactly one scan which reported tons of errors
in the devmon log and then nothing happens any more. The Hobbit devmon
tests of all devices get purple after some time.
One of our UPS's was the last to be moved to a new network, and this caused no problems.

Can you provide more detail:
1)What version of devmon are you running?
2)Is hobbit still testing this device?
3)Was there a conn test for this device? Is it still there? What colour is it currently
4)Can you provide the useful parts of the log?
How can I setup devmon to ignore such errors and not stop working.
Usually devmon should not poll the device if the conn test is red, and even if it does, it should at worst time out for the maximum of (SNMPTIMEOUT * SNMPTRIES) and MAXPOLLTIME. While it is timing out the fork that is polling this device, the other forks should continue polling ....

Regards,
Buchan