A problem to check QNAP through SSH
Posted: Fri Sep 18, 2020 4:06 am
Hi, i've made a simple scritp to check if the syslog file on a nas is updated and locally (on the nas) is working.
This is the script:
locally i got this result:
But when i run the check from nagios with the command
the result is
i always got z=18 and i don't undestand when it came from..
maybe the ip but i don't undestand
any idea?
This is the script:
Code: Select all
#!/bin/bash
z=`ls /share/CACHEDEV1_DATA/Public/messages -l | awk -F'administrators' '{print $2}' | awk '{print $3}' | cut -c 1-4`
y=`date | awk '{print $4}' | cut -c 1-4`
if [ "$z" = "$y" ]
then
echo "Ricezione Syslog Funzionante (z=$z y=$y)"
exit 0
else
echo "Attenzione, controllare funzionamento Syslog. (z=$z y=$y)"
exit 1
fi
Code: Select all
Ricezione Syslog Funzionante (z=11:0 y=11:0)Code: Select all
/usr/local/nagios/libexec/check_by_ssh -H xx.xx.xx.18 -C "/nagios/check_syslog.sh" -p 9022 --logname=adminCode: Select all
Attenzione, controllare funzionamento Syslog. (z=18 y=11:0)maybe the ip but i don't undestand
any idea?