T
T
Teyla2018-03-27 17:14:53
linux
Teyla, 2018-03-27 17:14:53

How to do so. so that zabbix correctly executes the script?

Good afternoon.
You need to monitor one device using External Check.
The script that zabbix calls looks like this:

#!/bin/bash

status=`/etc/BGCashcheckServer/testserver.sh --dotest | grep Смена | sed 's/Смена открыта: //'`

if 
then
    echo "1"
else
   echo "0"
fi

The fact is that if you manually run the script, then 1 is displayed, but if Zabbix does it, then 0.
I already found out that when executed by Zabbix, the $status variable does not contain anything inside.
Is it about rights or something else?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Varlamov, 2018-03-27
@bes_internal

From documentation:
So it is chmod o+x /etc/BGCashcheckServer/testserver.shchecked throughsudo -u zabbix ваш_скрипт.sh

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question