Ad Widget

Collapse

same custom script, but different return value from zabbix_get

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bill Wang
    Member
    • Jul 2010
    • 66

    #1

    same custom script, but different return value from zabbix_get

    Hi all,

    I'm using zabbix 2.2.7 on my several centos servers, recently I had to monitor some 3rd party ARM devices which connected to my monitored servers, so I wrote a bash script to simply ping those devices and print the command execution return code, like "1" means device unreachable, "0" means device alive.

    The script run well on all my servers, but when I added UserParameter to each agent, then the zabbix server always got the unreachable return code, and I manually run zabbix_get on server side, it returns the same wrong code, how could this happen? Anyone got an idea?

    Thx a lot!!!

    ----------
    Did more test just now, changed "AllowRoot" to 1, then zabbix_get worked as expected, but I switched to zabbix user to run that script, worked good as well.
    ----------
    -----SOLUTION-----
    I'm using openRTSP to monitor IP cameras' RTSP streams, that tool will write some data to current working directory, when zabbix_get runs that command as zabbix user, the current working directory becomes to "/" the root directory, and zabbix user doesn't have write permission to "/", so script return fail code. Added "no-receive" parameters to openRTSP command line, all things live happier than ever.
    openRTSP -r -p <custome_port> -d <duration_second> <rtsp_url>
    ----------
    Last edited by Bill Wang; 08-07-2015, 06:14. Reason: solved
Working...