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
Problem with my plugin the status information is "null"
-
silver9195
- Posts: 3
- Joined: Wed Sep 05, 2018 9:04 am
-
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"
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
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-
silver9195
- Posts: 3
- Joined: Wed Sep 05, 2018 9:04 am
Re: Problem with my plugin the status information is "null"
No ...
When i test with nagios user is fail in fact ...
i will do it now and i reply
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:
-
silver9195
- Posts: 3
- Joined: Wed Sep 05, 2018 9:04 am
Re: Problem with my plugin the status information is "null"
Perfect !!!
Thanks a lot man !
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"
Great! Locking threadsilver9195 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 !