Tripp Lite Check_PDU plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Tripp Lite Check_PDU plugin

Post 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
Thanks so much,
Tom
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Tripp Lite Check_PDU plugin

Post 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
Former Nagios Employee
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Tripp Lite Check_PDU plugin

Post 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)
Thanks so much,
Tom
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Tripp Lite Check_PDU plugin

Post 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)
Former Nagios Employee
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Tripp Lite Check_PDU plugin

Post 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
Thanks so much,
Tom
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Tripp Lite Check_PDU plugin

Post by rkennedy »

Are you able to run it manually from the CLI?

Please post the command + service definition you're using to monitor with.
Former Nagios Employee
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Tripp Lite Check_PDU plugin

Post 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
#
##############################################################################
Thanks so much,
Tom
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Tripp Lite Check_PDU plugin

Post 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?
Former Nagios Employee
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Tripp Lite Check_PDU plugin

Post 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.
Thanks so much,
Tom
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Tripp Lite Check_PDU plugin

Post 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?
Former Nagios Employee
Locked