Hi,
I have a script that tests to see if there is any process running on port 80 (this isn't apache)
On the server my script is as follows:
If I run this with the service that uses that port running it returns 1, if its stopped it returns 0.
Running this from the zabbix server gives a blank result:
I added another userparameter as follows:
This produces the correct result on the server if run via bash, giving 1 if their is a process on that port and 0 if not.
Running it from the remote zabbix server I get:
Not sure what I am missing, any advice?
I have a script that tests to see if there is any process running on port 80 (this isn't apache)
On the server my script is as follows:
Code:
#!/bin/bash if [ -z "$(lsof -i :80)" ]; then echo 0 else echo 1 fi
Running this from the zabbix server gives a blank result:
Code:
root@zabbix:~# /usr/bin/zabbix_get -I{zabbix server} -s {target IP} -p 10050 -k test
root@zabbix:~#
Code:
UserParameter=test2,[[ -z "$(lsof -i :80)" ]] && echo 1 || echo 0
Running it from the remote zabbix server I get:
Code:
root@zabbix:~# /usr/bin/zabbix_get -I{zabbix server} -s {target IP} -p 10050 -k test2
1
root@zabbix:~#
Comment