Page 1 of 1

Plugin executes on CLI not in XI

Posted: Fri Jun 28, 2013 9:00 am
by SRSPharmacy
I have seen this on a few other posts and tried what was listed there.

When I run the plugin on the cli everything comes back good.

when I run it as a scheduled check in XI I just get a Status (null)


[nagios@nagios1 libexec]$ ./SRS_check_rhev3 -H rhevm.cloud2 -f .authfile -R rhhva.cloud2 -l cpu
RHEV OK: cpu ok - 4% used (rhhva.cloud2.srs.local) |cpu=4%;60;80;0; cpu.current.user=1;;;0; cpu.current.system=2;;;0; cpu.current.idle=96;;;0;

This is the check_rhev3 plugin from the exchange, downloaded from git_hub. the SRS prefix is just a rename of the file for standardizing local usage. the command works the same with or without the rename.

there is already this at the top

#!/usr/bin/perl -w
# nagios: -epn

so it isn't trying to use the embedded perl.

Any thoughts?

Nagios XI 2012R1.3

Re: Plugin executes on CLI not in XI

Posted: Fri Jun 28, 2013 9:09 am
by slansing
Can you provide a direct link to the plugin?

Re: Plugin executes on CLI not in XI

Posted: Fri Jun 28, 2013 9:11 am
by SRSPharmacy

Re: Plugin executes on CLI not in XI

Posted: Fri Jun 28, 2013 9:49 am
by slansing
Can you show us the command, and service definition for the check in question?

Re: Plugin executes on CLI not in XI

Posted: Fri Jun 28, 2013 9:54 am
by SRSPharmacy
command def.

define command {
command_name SRS_check_rhev_cpu_cloud2
command_line $USER1$/SRS_check_rhev3 -H rhevm.cloud2 -f .authfile -R rhhva.cloud2 -l cpu
}


###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2013-06-28 10:52:32
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define service {
host_name rhhva.cloud2.srs.local
service_description rhhva.cloud2 - CPU
use generic-service
display_name rhhva.cloud2 - CPU Utilization
check_command SRS_check_rhev_cpu_cloud2!!!!!!!!
register 1
}

Re: Plugin executes on CLI not in XI

Posted: Fri Jun 28, 2013 10:08 am
by sreinhardt
Where is this .authfile located? by default nagios sets the working directory as /home/nagios, so if it is in the libexec dir you might want to alter the flag to :

-f $USER1$/.authfile

edit: I should note that it might require a little escaping with the / in there, but hopefully not.

Re: Plugin executes on CLI not in XI

Posted: Fri Jun 28, 2013 10:34 am
by SRSPharmacy
ah ha! That did it. Thanks!

Re: Plugin executes on CLI not in XI

Posted: Fri Jun 28, 2013 10:36 am
by slansing
Great! Closing as resolved.