Page 1 of 2

Tripp Lite Check_PDU plugin

Posted: Mon Feb 06, 2017 1:52 pm
by hillhealthcenter
I'm trying to use the Check_PDU plugin for Tripp Lite PDUs from the Exchange. However, I'm getting this error:

Code: Select all

(No output on stdout) stderr: Can't locate utils.pm in @INC (@INC contains: /usr/local/libexec/nagios /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at /usr/local/nagi
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_pdu line 7

Re: Tripp Lite Check_PDU plugin

Posted: Mon Feb 06, 2017 1:58 pm
by rkennedy
It looks like it's sourcing /usr/local/libexec/nagios and not /usr/local/nagios/libexec - you should be able to update the plugin to include that path and get things working properly.

Code: Select all

[root@centos7 etc]# locate utils.pm
/usr/local/nagios/libexec/utils.pm
/usr/local/nrdp/plugins/AIX/utils.pm
/usr/local/nrdp/plugins/Generic/utils.pm
/usr/local/nrdp/plugins/SunOS/utils.pm

Re: Tripp Lite Check_PDU plugin

Posted: Mon Feb 06, 2017 2:14 pm
by hillhealthcenter
Thanks for getting back to me so quickly. Now I'm getting this error:

Code: Select all

(Return code of 255 is out of bounds)

Re: Tripp Lite Check_PDU plugin

Posted: Mon Feb 06, 2017 2:27 pm
by rkennedy
What are the permissions on it? ls -la /usr/local/nagios/libexec/check_pdu

My guess is they're set to root:root, and you'll just want to adjust it accordingly. (generally apache:nagios)

Re: Tripp Lite Check_PDU plugin

Posted: Mon Feb 06, 2017 2:36 pm
by hillhealthcenter
Here's output:

Code: Select all

/usr/local/nagios/libexec$  ls -la /usr/local/nagios/libexec/check_pdu
-rwxr-xr-x 1 apache nagios

Re: Tripp Lite Check_PDU plugin

Posted: Mon Feb 06, 2017 2:50 pm
by rkennedy
Are you able to run it manually from the CLI?

Please post the command + service definition you're using to monitor with.

Re: Tripp Lite Check_PDU plugin

Posted: Mon Feb 06, 2017 4:12 pm
by hillhealthcenter
I get this error from the CLI:

Code: Select all

/usr/local/nagios/libexec$ ./check_pdu -h 192.168.90.72 tripplite inputv 105 118
Can't call method "getnext" on an undefined value at ./check_pdu line 45.
Here are the command and service configs:

Code: Select all

define command {
       command_name                  		check_pdu
       command_line                  		$USER1$/check_pdu -H $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$
}

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.5
# Date:	      2017-02-06 16:07:16
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
	host_name			Nicoll PDU
	service_description		Ping
	use				xiwizard_genericnetdevice_ping_service
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contacts			tom
	_xiwizard			genericnetdevice
	register			1
	}	

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
##############################################################################

Re: Tripp Lite Check_PDU plugin

Posted: Mon Feb 06, 2017 4:29 pm
by rkennedy
Noticing this in the usage -

Code: Select all

my $usage = '
Usage: ${0} hostname snmp_community key min max
I don't think you need the -h in there as it's messing up where the IP should be.

The other part is in the header -

Code: Select all

use SNMP; # requires net-mgmt/p5-Net-SNMP
Do you have that package installed?

Re: Tripp Lite Check_PDU plugin

Posted: Mon Feb 06, 2017 4:47 pm
by hillhealthcenter
I'm not sure if I have that particular package installed. How do I check? I'm already using SNMP to monitor APC UPS devices in our network, if that helps.

Re: Tripp Lite Check_PDU plugin

Posted: Mon Feb 06, 2017 5:19 pm
by rkennedy
After reviewing https://secure-computing.net/wiki/index.php/PDU_Nagios - I believe net-snmp on CentOS should cover it.

Are you still seeing the same error after altering your check command to remove the -h, or what is the result now?