UPS

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: UPS

Post 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 ...
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: UPS

Post by abrist »

Follow the help:

Code: Select all

/usr/bin/perl ./check_ups_pow.pl -H <hostname> -C <community>
Obviously, replace <hostname> and <community>. . .
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: UPS

Post 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#
test541
Posts: 14
Joined: Wed May 22, 2013 4:20 am

Re: UPS

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: UPS

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: UPS

Post 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#
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: UPS

Post by abrist »

The plugin now works (in your second example), but the OID does not exist . . .
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked