Hi,
I wrote a script to check the reachability of my MPLS VPN devices. When i run my script manually it returns the correct value( device alive=1, unreachable=0). But, i can't figure out why zabbix always returns the value 0 weather the host is reacheble or not.
The script:
Item:
Host: Test
Description: check
Type: External check
Key: check.sh[eth1.153,{IPADDRESS}]
Tigger:
Name: {HOSTNAME} is Unreachable
Expression (Toggle input method): {Test:check.sh[eth1.153,{IPADDRESS}].last(90)}=0
Comments: Can not Ping {HOSTNAME} 3 times in last 1 minute 30
The zabbix log file shows:
Does anyone know how to do this?
Many thanks,
Mike,
I wrote a script to check the reachability of my MPLS VPN devices. When i run my script manually it returns the correct value( device alive=1, unreachable=0). But, i can't figure out why zabbix always returns the value 0 weather the host is reacheble or not.
The script:
Code:
#!/bin/sh fping -q -I $1 $2 > /dev/null 2>&1 if [ $? == 0 ]; then echo 1 exit 1 else echo 0 exit 0 fi
Host: Test
Description: check
Type: External check
Key: check.sh[eth1.153,{IPADDRESS}]
Tigger:
Name: {HOSTNAME} is Unreachable
Expression (Toggle input method): {Test:check.sh[eth1.153,{IPADDRESS}].last(90)}=0
Comments: Can not Ping {HOSTNAME} 3 times in last 1 minute 30
The zabbix log file shows:
Code:
762:20100624:114705.651 In substitute_simple_macros (data:'check.sh[eth1.153,{IPADDRESS}]')
762:20100624:114705.651 End substitute_simple_macros (result:'check.sh[eth1.153,192.168.49.124]')
762:20100624:114705.651 In get_value() key:'check.sh[eth1.153,{IPADDRESS}]'
762:20100624:114705.651 In get_value_external() key:'check.sh[eth1.153,{IPADDRESS}]'
762:20100624:114705.651 DEBUG [check.sh]
762:20100624:114705.651 params [eth1.153,192.168.49.124]
762:20100624:114705.651 /etc/zabbix/externalscripts/check.sh 192.168.49.124 eth1.153,192.168.49.124
762:20100624:114705.657 Result [0]
762:20100624:114705.657 End of get_value():SUCCEED
Many thanks,
Mike,
Comment