Ad Widget

Collapse

Custom alertscript feedback on action

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JvGinkel
    Junior Member
    • Jan 2014
    • 10

    #1

    Custom alertscript feedback on action

    For our stand by shift I have created a bash script that will send out an SMS to the defined cell phone. The script itself works after a bit tweaking, including error logging, however I am a bit concerned by the action status in Zabbix itself.

    The SMSs are send by creating an XML file that is fed with curl to an internet SMS sender using https. On our test service this connection is blocked by the firewall (as it should), however Zabbix itself tells us that is has been send. In the script I exit with an error code (exit 100) which is intended to let Zabbix know the alerting was a failure, but somehow it seems that Zabbix isn't picking up on this exit code: if the script has been run and finished it doesn't bother about the exit code. Is there a way for me to set this up so that we can see in the GUI the alerting has been failed?

    We are using Zabbix 2.2.1 on RHEL 6.

    Screenshots of the GUI and configuration:



  • JvGinkel
    Junior Member
    • Jan 2014
    • 10

    #2
    Anyone got an idea how to achieve this?

    Comment

    • steveboyson
      Senior Member
      • Jul 2013
      • 582

      #3
      Let your script feed a zabbix trapper item and send the status code there.
      So you can define a trigger which fires on errors.

      Comment

      • JvGinkel
        Junior Member
        • Jan 2014
        • 10

        #4
        Thank you for your reply, I have implemented it in our config.

        Comment

        • steveboyson
          Senior Member
          • Jul 2013
          • 582

          #5
          Fine! Just make sure that you do not create a feedback loop.

          1.) trigger fires
          2.) alert script wants to send SMS notification
          3.) alert script failes, raises an error
          4.) trigger fires for error notification
          5.) goto 2

          Comment

          • JvGinkel
            Junior Member
            • Jan 2014
            • 10

            #6
            Yeah, the severity of the trap has been set high enough to be noticed but low enough that it won't create another alertscript execution. If necessary the trap could also be incorporated in the action conditions, but for now it's fine by how it's being set up.

            Comment

            Working...