Ad Widget

Collapse

V 1.4.4: cannot make alert script run

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chrism01
    Junior Member
    • Feb 2008
    • 11

    #1

    V 1.4.4: cannot make alert script run

    Guys,

    Have set up

    Item:

    Checksum of /home/zabbix/bin/trigger.dat vfs.file.cksum[/home/zabbix/bin/trigger.dat] 30 7 365 ZABBIX agent Active Integrity

    Trigger:

    trigger.dat has changed {ZABBIX Server:vfs.file.cksum[/home/zabbix/bin/trigger.dat].diff(0)}>0 High Enabled

    Action:

    alert_test Trigger = "trigger.dat has changed"
    Send message to User "smcits"
    Enabled

    Under user smcits:

    alert_script smcits 1-7,00:00-23:59; NIWAHD Enabled

    Media types:
    Script alert_script Script name: 'test_zabbix.pl'

    Server conf:

    # Location for custom alert scripts
    AlertScriptsPath=/home/zabbix/bin/


    Actual dir:
    /home/zabbix/bin


    -rwxr-xr-x 1 zabbix users 13509 2008-02-15 11:29 test_zabbix.pl


    I get lots of alerts in Zabbix as wanted, but it never fires the script.
    What do I need to do to make it fire the script????

    Cheers
    Chris
  • dreas
    Member
    • Aug 2007
    • 89

    #2
    What happens if you execute /home/zabbix/bin/test_zabbix.pl directly from the prompt as user zabbix? Does that work fine?

    Comment

    • chrism01
      Junior Member
      • Feb 2008
      • 11

      #3
      you may find this hard to believe, but I did try that
      and it worked ...
      but zabbix won't run it ... grrr

      Comment

      • dreas
        Member
        • Aug 2007
        • 89

        #4
        Did you check the Zabbix logs for any errors? Perhaps you can PM me access so I can verify your settings?

        Comment

        • chrism01
          Junior Member
          • Feb 2008
          • 11

          #5
          Dreas,
          Thx for continuing to help.

          There doesn't seem to be any errors.
          If you want to tell me what you want to see I can post here or PM (or email ) the log.
          I did a short test with DebugLevel=4 and got 6.6MB of log.
          I can just send you the relevant section(s) if you want, or the whole thing.
          Definitely can't give you direct access.

          Cheers
          Chris

          Comment

          • dreas
            Member
            • Aug 2007
            • 89

            #6
            Have you tried using a simple shell script to see if that is called (instead of your Perl program)?

            Comment

            • chrism01
              Junior Member
              • Feb 2008
              • 11

              #7
              I'll give it a shot, although the test perl script is pretty simple right now....


              Edit:
              test done, results as before ie zabbix updates itself, but doesn't run script (yes it runs manually).
              Last edited by chrism01; 25-02-2008, 02:00. Reason: test done

              Comment

              • dreas
                Member
                • Aug 2007
                • 89

                #8
                Hmm I really have no clue. As far as I can tell your settings are correct. The Zabbix logs show no clues at all?

                Comment

                • chrism01
                  Junior Member
                  • Feb 2008
                  • 11

                  #9
                  Well, it shows no errors, so I'm guessing one of my settings (see OP above) is incorrect.
                  Unfortunately I can't find a good step-by-step example, the ones I've found always skip something.

                  I've attached the relevant portion (DebugLevel=4) of the server log.
                  Let me know if you want anything else.

                  Cheers
                  Chris
                  PS Just to confirm: triggerid=13066, actionid=4,itemid=20031 look correct when I check the DB.
                  Attached Files

                  Comment

                  • dreas
                    Member
                    • Aug 2007
                    • 89

                    #10
                    I checked your posted settings several times but couldn't see an issue. Let's do this step by step. First of all .. is the action triggered? (Monitoring, Actions). What's the status?

                    Comment

                    • chrism01
                      Junior Member
                      • Feb 2008
                      • 11

                      #11
                      Yep, as per my OP etc, it all works as far as the forms are concerned ie alerts appear under monitoring etc (see also that logfile excerpt), eg:

                      ***********************
                      Monitor/Events
                      2008.Feb.25 09:48:51 trigger.dat has changed ON High
                      2008.Feb.25 09:48:21 trigger.dat has changed OFF High
                      2008.Feb.25 09:47:51 trigger.dat has changed ON High
                      2008.Feb.25 09:47:21 trigger.dat has changed OFF High
                      2008.Feb.25 09:46:51 trigger.dat has changed ON High
                      2008.Feb.25 09:45:51 trigger.dat has changed OFF High

                      *************************
                      Monitor/Actions
                      2008.Feb.25 11:40:32 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: OFF test alert msging


                      2008.Feb.25 09:48:51 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: ON test alert msging


                      2008.Feb.25 09:48:21 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: OFF test alert msging


                      2008.Feb.25 09:47:51 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: ON test alert msging


                      2008.Feb.25 09:47:21 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: OFF test alert msging


                      2008.Feb.25 09:46:51 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: ON test alert msging


                      2008.Feb.25 09:45:51 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: OFF test alert msging


                      2008.Feb.25 09:45:31 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: ON test alert msging


                      2008.Feb.25 09:13:45 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: OFF test alert msging


                      2008.Feb.25 09:09:51 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: ON test alert msging


                      2008.Feb.25 09:08:51 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: OFF test alert msging


                      2008.Feb.25 09:08:45 alert_script sent smcits

                      Subject: test_alert

                      trigger.dat has changed: ON test alert msging

                      *************************
                      Reports/Avail
                      trigger.dat has changed 2.1177% 83.9445% 13.9378%

                      ************************
                      Reports/Most busy triggers top 100
                      ZABBIX Server trigger.dat has changed High 28


                      HTH
                      Chris

                      Comment

                      • dreas
                        Member
                        • Aug 2007
                        • 89

                        #12
                        Hmm without access I am afraid I cannot help you. According to Zabbix the script does get called

                        Comment

                        • chrism01
                          Junior Member
                          • Feb 2008
                          • 11

                          #13
                          That's what I was afraid of ... you know what they say about the difference between theory & practice ...

                          I guess I'll have to figure out which MySQL table to check and write a cron job to track it and generate my own 'alerts'.

                          Nice to know it's not just me who thinks it 'ought' to be fine.

                          Comment

                          • dreas
                            Member
                            • Aug 2007
                            • 89

                            #14
                            Just to make sure .. you did test your scripts using the zabbix user right? Not that it's a permission issue or something.

                            Comment

                            • dreas
                              Member
                              • Aug 2007
                              • 89

                              #15
                              Hmm interestingly I seem to experience a similar issue now. I have 2 scripts .. 1 works fine .. the other one does not seem to be activated (even though it shows in Zabbix the notification is sent). Will test further

                              You're bad luck!

                              Comment

                              Working...