Page 2 of 2

Re: UPS

Posted: Tue Jul 09, 2013 8:47 am
by MPIvan
Here it is ....

root@nagios:/usr/local/nagios/libexec# /usr/bin/perl ./check_ups_pow.pl -h
No hostname specified
-----------------------------------------------------------------
check_ups_pow.pl v1.0

Monitors PowerWare UPS via SNMP management card.

Usage: check_ups_pow.pl -H <hostname> -C <community> [...]

Options: -H Hostname or IP address
-C Community (default is public)

-----------------------------------------------------------------
Copyright 2004 Altinity Limited

This program is free software; you can redistribute it or modify
it under the terms of the GNU General Public License
-----------------------------------------------------------------

root@nagios:/usr/local/nagios/libexec#
so how can now i fix this .... and tnx for helping me ...

Re: UPS

Posted: Tue Jul 09, 2013 11:50 am
by abrist
Follow the help:

Code: Select all

/usr/bin/perl ./check_ups_pow.pl -H <hostname> -C <community>
Obviously, replace <hostname> and <community>. . .

Re: UPS

Posted: Wed Jul 10, 2013 6:01 am
by MPIvan
Ok for using the pluging but do i always have to execute like this ... with "/usr/bin/perl" in front of it .... and if do, then i suppose i have to make the command in commands.cfg file like that with "/usr/bin/perl" in fron ... or is there a way to fix this in some other way ... ?

Also i have this problem now but i think i can handle it, i guess i have to dl mibs and fix this ...
root@nagios:/usr/local/nagios/libexec# /usr/bin/perl ./check_ups_pow.pl -H 192.168.100.200 -C Test123
Status is a WARNING level - SNMP OID does not exist|
root@nagios:/usr/local/nagios/libexec#

Re: UPS

Posted: Wed Jul 10, 2013 6:16 am
by test541
Isn't it a problem related to perl script copied from Windows to Linux machine?

Code: Select all

^M
suggests badly converted end of line characters (\r\n instead \n) in script file. You can see them after openning the file in vi editor.

Re: UPS

Posted: Wed Jul 10, 2013 11:24 am
by sreinhardt
Yes, you should be able to open in it in vim and change the line endings.

Code: Select all

vim [filename]
:set ff=unix
:wq
Then try to execute it again without /bin/perl in front.

Re: UPS

Posted: Thu Jul 11, 2013 5:50 am
by MPIvan
Here it is the result without "/usr/bin/perl"
root@nagios:/usr/local/nagios/libexec# vim check_ups_pow.pl
root@nagios:/usr/local/nagios/libexec# ./check_ups_pow.pl -h
-bash: ./check_ups_pow.pl: /usr/local/groundwork/bin/perl: bad interpreter: No such file or directory
root@nagios:/usr/local/nagios/libexec#
and here it is with "/usr/bin/perl "
root@nagios:/usr/local/nagios/libexec# /usr/bin/perl ./check_ups_pow.pl -H 192.168.100.200 -C mkptrlHQ
Status is a WARNING level - SNMP OID does not exist|
root@nagios:/usr/local/nagios/libexec#

Re: UPS

Posted: Thu Jul 11, 2013 10:27 am
by abrist
The plugin now works (in your second example), but the OID does not exist . . .