Guess we closed this out too soon.
I was trying to set up another service from this plugin, I was going to check Battery Time Remaining. When I ran it from the command line, I got this error:
[root@hhscnagios ~]# /usr/local/nagios/libexec/check_ups_alarm.pl -H 10.5.210.35 -C j613LmNZ -X batteryMinRemaining -w 15 -c 10
Insecure dependency in printf while running with -T switch at /usr/local/nagios/libexec/check_ups_alarm.pl line 265.
I found this on the Exchange Plugin page where I got the plugin, posted by chriscamm.
If you get the following error:
Insecure dependency in printf while running with -T switch at ./check_ups_alarm.pl line 266.
Edit the script and on Line 1 change
#!/usr/bin/perl -wT
to
#!/usr/bin/perl
Then above
use scrict;
Add the following line
use warnings;
use scrict;
This corrects the error and I can now run all of the checks.
So I did that, but then the Battery Status check that was working failed with "Error 126 Out Of Bounds, plugin may not be executable."
So I undid those changes, and the Battery Status check went back to green.
Is that some bogus info on the Exchange page, or am I doing something wrong again?
New Issue with Liebert UPS
New Issue with Liebert UPS
Charles Masteller
Information Systems Specialist
Hawaii Health Systems Corp.
"No one will ever need more than 640K RAM". Bill Gates
Information Systems Specialist
Hawaii Health Systems Corp.
"No one will ever need more than 640K RAM". Bill Gates
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: New Issue with Liebert UPS
#!/usr/bin/perl -wT
-w is the same as
use warnings;
-T is "enable tainting checks" ...
http://gunther.web66.com/FAQS/taintmode.html
You really want to fix the core of the problem. What is really going on here is that the script is aborting because of an issue with the $nagios_message variable.
If I backtrack through the code, specifically:
$snmp_battery_min_remain = "1.3.6.1.2.1.33.1.2.3.0";
You might want to make sure that the UPS is returing a value for this OID.
or
If it is, then you need to spend time in the code working out what the script does and where it is breaking. If it is not returning a value then perhaps the UPS does report on this OID.
-w is the same as
use warnings;
-T is "enable tainting checks" ...
http://gunther.web66.com/FAQS/taintmode.html
What is taint mode? Why do I need it?
Freeware CGI Scripts are available for download all over the Web. But how many of them are really secure? When you download a script do you check all the logic to make sure it is secure? Do you read through each line of code and anticipate all the ramifications? Most of the time the answer is "no". After all, the whole point of downloading software is to get it and run it for free WITHOUT having to do a lot of work.
I'm writing this to tell you that there isn't any free lunch out there. The more complicated a CGI script is, the more likely you will want to find someone else who has already programmed it and avoid doing the work yourself.
The problem is that regardless of how good the author is, every large program has a good probability of having bugs -- some of them may be security bugs.
One very good way to lock out security bugs in Perl code is to turn on TAINT mode. TAINT mode puts a Perl script into "PARANOID" mode and treats ALL user supplied input as tainted and bad unless the programmer explicitly "OKs" the data.
You really want to fix the core of the problem. What is really going on here is that the script is aborting because of an issue with the $nagios_message variable.
If I backtrack through the code, specifically:
$snmp_battery_min_remain = "1.3.6.1.2.1.33.1.2.3.0";
You might want to make sure that the UPS is returing a value for this OID.
Code: Select all
snmpwalk -m all -v 2c -c j613LmNZ 10.5.210.35 1.3.6.1.2.1.33.1.2.3.0Code: Select all
snmpwalk -m all -v 2c -c j613LmNZ 10.5.210.35 1.3.6.1.2.1.33.1.2.3As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: New Issue with Liebert UPS
Thanks Box.
Looks like I've got some reading to do.
Marked this closed, let me get a little more up to speed on all of this.
Mahalo
Looks like I've got some reading to do.
Marked this closed, let me get a little more up to speed on all of this.
Mahalo
Charles Masteller
Information Systems Specialist
Hawaii Health Systems Corp.
"No one will ever need more than 640K RAM". Bill Gates
Information Systems Specialist
Hawaii Health Systems Corp.
"No one will ever need more than 640K RAM". Bill Gates