Problem with my plugin the status information is "null"

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.
Locked
silver9195
Posts: 3
Joined: Wed Sep 05, 2018 9:04 am

Problem with my plugin the status information is "null"

Post by silver9195 »

sorry for my english i'm a frenchy !

Hi,


I try to do my own plugin on nagios which run a script on over server by ssh,

L'ensemble des étapes sont ok le plugin se lance bien et me retourne ce que je veux en ligne de commande MAIS sur Nagios il me retourne le résultat "null" en vert ...

All run fine, the plugin return the good value on my server BUT on Nagios web the result information is "null" in green

My plugin :
CODE : TOUT SÉLECTIONNER

#!/bin/sh

##################################################################
# Creation: SuperBeubeu
# Last Modification:
# This script checks script wynid_monetique sur upnet02
##################################################################

STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_DEPENDENT=4



valeur=$(ssh [email protected] /usr/local/apache2/htdocs/wynid/plugins/wynid_monetique | grep "10.62.253.8" | grep 'serial 1/0' | sed 's/10.62.253.8.*NOCALLs://g')

if [ $valeur -le 100 ]
then
echo "Nombre de Call Clear inférieur à 100 : "$valeur""
exit 0

elif [ $valeur -gt 100 ]
then
echo "Alerte on dépasse les 100 Calls Clear ! "$valeur""
exit 2
fi

On my server : :
[root@l000pkl120 plugins]# sh check_script_monetique.sh
Alerte on dépasse les 100 Calls Clear ! 108348


On Web Nagios :
Current Status: OK (for 0d 0h 9m 39s)
Status Information: (null)

Do you have any ideas ?

Thks a lot
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with my plugin the status information is "null"

Post by scottwilkerson »

Did you setup a ssh shared key for the nagios user?

when you are running it from the CLI you are root, what happens if you run

Code: Select all

su nagios
sh check_script_monetique.sh
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
silver9195
Posts: 3
Joined: Wed Sep 05, 2018 9:04 am

Re: Problem with my plugin the status information is "null"

Post by silver9195 »

No ...

When i test with nagios user is fail in fact ...

i will do it now and i reply
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with my plugin the status information is "null"

Post by scottwilkerson »

sounds good
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
silver9195
Posts: 3
Joined: Wed Sep 05, 2018 9:04 am

Re: Problem with my plugin the status information is "null"

Post by silver9195 »

Perfect !!!


Current Status: CRITICAL (for 0d 0h 0m 8s)
Status Information: Alerte on dépasse les 100 Calls Clear ! 108379

Thanks a lot man !
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with my plugin the status information is "null"

Post by scottwilkerson »

silver9195 wrote:Perfect !!!


Current Status: CRITICAL (for 0d 0h 0m 8s)
Status Information: Alerte on dépasse les 100 Calls Clear ! 108379

Thanks a lot man !
Great! Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked