Page 1 of 1

Problem with my plugin the status information is "null"

Posted: Wed Sep 05, 2018 9:20 am
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

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

Posted: Wed Sep 05, 2018 10:04 am
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

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

Posted: Wed Sep 05, 2018 10:34 am
by silver9195
No ...

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

i will do it now and i reply

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

Posted: Wed Sep 05, 2018 10:43 am
by scottwilkerson
sounds good

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

Posted: Wed Sep 05, 2018 11:48 am
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 !

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

Posted: Wed Sep 05, 2018 11:52 am
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