Ad Widget

Collapse

Problem with external check item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HarryKalahan
    Member
    • Jan 2014
    • 40

    #1

    Problem with external check item

    Good morning!

    I have a problem when I try to create an external check item in a host which executes an script that checks a mail loop (sending and receiving).

    This item becomes "Not supported" because it takes, at least, 5 minites or more to finish and deliver the desired value.

    This is a custom script imported from Nagios but adapted for Zabbix enviroment. The timeout parameter in our Zabbix Server configuration is 30, but we
    wouldn't like to change this value, because it could affect all the installation.

    We tried to use a second script which run the first script mentioned in background. Let me to explain it correctly:

    script 1: mail_init_check.sh (see attached file)

    This script send the value "1" with echo to the external check item and then it would run the mail_loop check script in backgroud (check_correo.sh). Thus the item
    doesn't become Not supported.

    script2: check_correo.sh (see attached file)

    This script would be executed in background while firt one send the value 1 to the external check item, and the when script2 finish its execution, would send
    the result to a Zabbix Trapper item created in Zabbix Server, but it doesn't work. We only receive the value 1, and making a ps -xa, we see that script2 doesn't run.
    It works OK if I execute script 1 locally in the terminal.

    Any idea would be much appreciated.

    Currently we are studing the option of creating a line in the crontab, but it's a dirty solution.

    Thank you very much. Best regards!
    Attached Files
  • steveboyson
    Senior Member
    • Jul 2013
    • 582

    #2
    I would suggest to just let the script run and immediatly return a value (for example in timeticks). So zabbix is fine with the timeout.

    When the script finishes, it sends trapper items to zabbix: one for "finish" (timeticks also), maybe "duration" and then your expected values.

    Using it that way you can circumvent the timeout settings.

    Comment

    Working...