I'm beginner user of Zabbix, and I'm trying to verify if a service is running on linux machine (other than zabbix server).
I created a script (zbx_service_check.sh) on /usr/lib/zabbix/externalscripts.
(I'm using postfix to test)
#!/bin/sh -x
service="postfix"
status=`/usr/sbin/service $service status`
if echo "$status" |grep -q "Active: active"; then
echo 0
else
echo 1
fi
fi
I created an item and a trigger (using expression {zabbix-lab:zbx_service_check.sh.last()}<>0 )
When I test it on Zabbix server, this works fine (I stop and start postfix using systemctl command and I got different values on "Latest data")
I configure same item and trigger on other server to be verifyied.
But, when I try to check other server, it is not work. I stop and start postfix on monitored server, but zabbix server only shows same status(value 0).
Is there a tip to make it work?
I created a script (zbx_service_check.sh) on /usr/lib/zabbix/externalscripts.
(I'm using postfix to test)
#!/bin/sh -x
service="postfix"
status=`/usr/sbin/service $service status`
if echo "$status" |grep -q "Active: active"; then
echo 0
else
echo 1
fi
fi
I created an item and a trigger (using expression {zabbix-lab:zbx_service_check.sh.last()}<>0 )
When I test it on Zabbix server, this works fine (I stop and start postfix using systemctl command and I got different values on "Latest data")
I configure same item and trigger on other server to be verifyied.
But, when I try to check other server, it is not work. I stop and start postfix on monitored server, but zabbix server only shows same status(value 0).
Is there a tip to make it work?
Comment