Ad Widget

Collapse

Alert scripts won't trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sculle
    Junior Member
    • Nov 2019
    • 1

    #1

    Alert scripts won't trigger

    I am new to zabbix. I am configuring a monitoring demo and need to execute a custom alert script. The test works successfully.
    When I fill up a file system, the alert triggers. I receive an email, but my alert script to MSTeams does not.

    Here is the log in debug. Custom alert script is actionid=7.

    Problem name: Free disk space is less than 10% on volume /home
    Host: stm-nag-01
    Severity: High

    2457:20191119:111459.300 query [txnlev:0] [select actionid from operations where recovery=1 and actionid in (3,7)]
    2457:20191119:111459.301 query [txnlev:0] [select eventid,source,object,objectid,clock,value,acknowl edged,ns,name,severity from events where eventid=103005 order by eventid]
    2457:20191119:111459.301 query [txnlev:0] [select distinct eventid from event_suppress where eventid=103005]
    2457:20191119:111459.301 query [txnlev:0] [select eventid,tag,value from event_tag where eventid=103005 order by eventid]
    2457:20191119:111459.302 query [txnlev:0] [select triggerid,description,expression,priority,comments ,url,recovery_expression,recovery_mode,value from triggers where triggerid=16762]
    2457:20191119:111459.302 In check_escalation() escalationid:2 status:active
    2457:20191119:111459.302 End of check_escalation()rocess error:''
    2457:20191119:111459.302 In escalation_execute() escalationid:2 status:active
    2457:20191119:111459.302 In escalation_execute_operations()
    2457:20191119:111459.302 query [txnlev:0] [select o.operationid,o.operationtype,o.esc_period,o.evalt ype,m.operationid,m.default_msg,m.subject,m.messag e,m.mediatypeid from operations o left join opmessage m
    on m.operationid=o.operationid where o.actionid=3 and o.operationtype in (0,1) and o.esc_step_from<=1 and (o.esc_step_to=0 or o.esc_step_to>=1) and o.recovery=0]
    2457:20191119:111459.303 In substitute_simple_macros() data:'0'
    2457:20191119:111459.303 In check_operation_conditions() operationid:3
    2457:20191119:111459.303 query [txnlev:0] [select conditiontype,operator,value from opconditions where operationid=3 order by conditiontype]
    2457:20191119:111459.305 End of check_operation_conditions():SUCCEED
    2457:20191119:111459.305 Conditions match our event. Execute operation.
    2457:20191119:111459.305 In add_object_msg()
    2457:20191119:111459.305 query [txnlev:0] [select userid from opmessage_usr where operationid=3 union select g.userid from opmessage_grp m,users_groups g where m.usrgrpid=g.usrgrpid and m.operationid=3]
    2457:20191119:111459.306 query [txnlev:0] [select count(*) from usrgrp g,users_groups ug where ug.userid=3 and g.usrgrpid=ug.usrgrpid and g.users_status=1]
    2457:20191119:111459.307 In get_trigger_permission()
    2457:20191119:111459.307 query [txnlev:0] [select type from users where userid=3]
    2457:20191119:111459.307 End of get_trigger_permission():rw
    2457:20191119:111459.307 In substitute_simple_macros() data:'Problem: {EVENT.NAME} on {HOST.NAME}'
    2457:20191119:111459.307 In DBget_trigger_value()
    2457:20191119:111459.307 In get_N_itemid() expression:'{18989}<10' N_functionid:1
    2457:20191119:111459.307 End of get_N_itemid():SUCCEED
    2457:20191119:111459.307 In DBget_item_value()
    2457:20191119:111459.307 End of DBget_trigger_value():SUCCEED
    2457:20191119:111459.307 End substitute_simple_macros() data:'Problem: Free disk space is less than 10% on volume /home on stm-nag-01'
    2457:20191119:111459.308 In substitute_simple_macros() data:'Problem started at {EVENT.TIME} on {EVENT.DATE}

    Problem name: {EVENT.NAME}
    Host: {HOST.NAME}
    Severity: {EVENT.SEVERITY}

    Original problem ID: {EVENT.ID}
    {TRIGGER.URL}'
    2457:20191119:111459.308 In DBget_trigger_value()
    2457:20191119:111459.308 In get_N_itemid() expression:'{18989}<10' N_functionid:1
    2457:20191119:111459.308 End of get_N_itemid():SUCCEED
    2457:20191119:111459.308 In DBget_item_value()
    2457:20191119:111459.308 End of DBget_trigger_value():SUCCEED
    2457:20191119:111459.308 In substitute_simple_macros() data:EMPTY
    2457:20191119:111459.308 End substitute_simple_macros() data:'Problem started at 11:14:58 on 2019.11.19

    Problem name: Free disk space is less than 10% on volume /home
    Host: stm-nag-01
    Severity: High

    Original problem ID: 103005
    '
    2457:20191119:111459.308 In add_user_msg()
    2457:20191119:111459.308 End of add_user_msg()
    2457:20191119:111459.308 query [txnlev:0] [select count(*) from usrgrp g,users_groups ug where ug.userid=4 and g.usrgrpid=ug.usrgrpid and g.users_status=1]
    2457:20191119:111459.309 In get_trigger_permission()
    2457:20191119:111459.309 query [txnlev:0] [select type from users where userid=4]
    2457:20191119:111459.309 End of get_trigger_permission():rw
    2457:20191119:111459.309 In substitute_simple_macros() data:'Problem: {EVENT.NAME} on {HOST.NAME}'
    2457:20191119:111459.309 In DBget_trigger_value()
    2457:20191119:111459.309 In get_N_itemid() expression:'{18989}<10' N_functionid:1
    2457:20191119:111459.309 End of get_N_itemid():SUCCEED
    2457:20191119:111459.309 In DBget_item_value()
    2457:20191119:111459.310 End of DBget_trigger_value():SUCCEED
    2457:20191119:111459.310 End substitute_simple_macros() data:'Problem: Free disk space is less than 10% on volume /home on stm-nag-01'
    2457:20191119:111459.310 In substitute_simple_macros() data:'Problem started at {EVENT.TIME} on {EVENT.DATE}

    Problem name: {EVENT.NAME}
    Host: {HOST.NAME}
    Severity: {EVENT.SEVERITY}

    Original problem ID: {EVENT.ID}
    {TRIGGER.URL}'
    2457:20191119:111459.312 In DBget_trigger_value()
    2457:20191119:111459.312 In get_N_itemid() expression:'{18989}<10' N_functionid:1
    2457:20191119:111459.312 End of get_N_itemid():SUCCEED
    2457:20191119:111459.312 In DBget_item_value()
    2457:20191119:111459.312 End of DBget_trigger_value():SUCCEED
    2457:20191119:111459.312 In substitute_simple_macros() data:EMPTY
    2457:20191119:111459.312 End substitute_simple_macros() data:'Problem started at 11:14:58 on 2019.11.19

    Problem name: Free disk space is less than 10% on volume /home
    Host: stm-nag-01
    Severity: High

    Original problem ID: 103005
    '
    2457:20191119:111459.312 In add_user_msg()
    2457:20191119:111459.312 End of add_user_msg()
    2457:20191119:111459.312 End of add_object_msg()
    2457:20191119:111459.312 In add_message_alert()
    2457:20191119:111459.312 query [txnlev:0] [select m.mediatypeid,m.sendto,m.severity,m.period,mt.stat us,m.active from media m,media_type mt where m.mediatypeid=mt.mediatypeid and m.userid=5]
    2457:20191119:111459.313 In substitute_simple_macros() data:'1-7,00:00-24:00'
    2457:20191119:111459.313 severity:4, media severity:48, period:'1-7,00:00-24:00', userid:5
    2457:20191119:111459.313 In DCget_nextid() table:'alerts' num:1
    2457:20191119:111459.313 End of DCget_nextid() table:'alerts' [177:177]
    2457:20191119:111459.313 query without transaction detected
    2457:20191119:111459.313 query [txnlev:0] [insert into alerts (alertid,actionid,eventid,userid,clock,mediatypeid ,sendto,subject,message,status,error,esc_step,aler ttype,acknowledgeid) values (177,3,103005,5
    ,1574180099,1,'****@******','Problem: Free disk space is less than 10% on volume /home on stm-nag-01','Problem started at 11:14:58 on 2019.11.19


    2457:20191119:111459.316 End of add_message_alert()
    2457:20191119:111459.316 query [txnlev:0] [select null from operations where actionid=3 and (esc_step_to>1 or esc_step_to=0) and recovery=0 limit 1]
    2457:20191119:111459.316 End of escalation_execute_operations()
    2457:20191119:111459.316 End of escalation_execute()
    2457:20191119:111459.316 In check_escalation() escalationid:1 status:active
    2457:20191119:111459.316 End of check_escalation()rocess error:''
    2457:20191119:111459.316 In escalation_execute() escalationid:1 status:active
    2457:20191119:111459.316 In escalation_execute_operations()
    2457:20191119:111459.316 query [txnlev:0] [select o.operationid,o.operationtype,o.esc_period,o.evalt ype,m.operationid,m.default_msg,m.subject,m.messag e,m.mediatypeid from operations o left join opmessage m
    on m.operationid=o.operationid where o.actionid=7 and o.operationtype in (0,1) and o.esc_step_from<=1 and (o.esc_step_to=0 or o.esc_step_to>=1) and o.recovery=0]
    2457:20191119:111459.316 In substitute_simple_macros() data:'0'
    2457:20191119:111459.316 In check_operation_conditions() operationid:13
    2457:20191119:111459.316 query [txnlev:0] [select conditiontype,operator,value from opconditions where operationid=13 order by conditiontype]
    2457:20191119:111459.316 End of check_operation_conditions():SUCCEED
    2457:20191119:111459.316 Conditions match our event. Execute operation.
    2457:20191119:111459.316 In add_object_msg()
    2457:20191119:111459.316 query [txnlev:0] [select userid from opmessage_usr where operationid=13 union select g.userid from opmessage_grp m,users_groups g where m.usrgrpid=g.usrgrpid and m.operationid=13]
    2457:20191119:111459.317 query [txnlev:0] [select count(*) from usrgrp g,users_groups ug where ug.userid=6 and g.usrgrpid=ug.usrgrpid and g.users_status=1]
    2457:20191119:111459.317 In get_trigger_permission()
    2457:20191119:111459.317 query [txnlev:0] [select type from users where userid=6]
    2457:20191119:111459.317 query [txnlev:0] [select distinct hg.groupid from items i join functions f on i.itemid=f.itemid join hosts_groups hg on hg.hostid = i.hostid and f.triggerid=16762]
    2457:20191119:111459.317 In get_hostgroups_permission()
    2457:20191119:111459.317 query [txnlev:0] [select min(r.permission) from rights r join users_groups ug on ug.usrgrpid=r.groupid where ug.userid=6 and r.id=2]
    2457:20191119:111459.317 End of get_hostgroups_permission():dn
    2457:20191119:111459.317 End of get_trigger_permission():dn
    2457:20191119:111459.317 End of add_object_msg()
    2457:20191119:111459.317 query [txnlev:0] [select null from operations where actionid=7 and (esc_step_to>1 or esc_step_to=0) and recovery=0 limit 1]
    2457:20191119:111459.318 End of escalation_execute_operations()
    2457:20191119:111459.318 End of escalation_execute()
  • Kachou
    Junior Member
    • Feb 2020
    • 10

    #2
    Hi Sculle,

    I am a beginner in Zabbix.
    I have the same problem as you.
    Did you find a solution?

    I'm lost...
    Thank you in advance.

    Kachou

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #3
      For some problems it may be necessary to go to the debug logs to determine whether an action has run, but as a first step it's often easier to look in Monitoring->Problems (on recent versions of Zabbix. Note that you don't say anything about what version of Zabbix you're using).

      If you can find the problem event in Monitoring->Problems, then look in the "Actions" column. If there is a "dot and arrow" symbol in the Actions column and you mouse over it, does it say anything about which actions were attempted, and any that may have failed?

      Comment

      • Kachou
        Junior Member
        • Feb 2020
        • 10

        #4
        Hello Tim,

        Thank you for answering.
        I am using version 4.4 of zabbix.
        I looked on the arrow "Actions" it is a problem of "No media defined for user."
        I will deactivate the emails to see if the problem disappears.

        Kachou

        Comment

        • tim.mooney
          Senior Member
          • Dec 2012
          • 1427

          #5
          "No media defined for user." can mean a couple of things, but the general problem is that the action wants to send an alert of a particular severity to a particular user, and that user doesn't have a media type defined that can receive alerts of that severity level.

          For example, you might have a Zabbix user 'kachou' defined that has a media type of "Email", but Email for "kachou" will only accept severity level "Warning". If an action wants to send an alert to user 'kachou' for a trigger of serverity = Disaster, then it can't because the only media type 'kachou' has is Email, and your email will only accept "Warning"-level severities.

          Both media types and action operations (the tab where you decide what an action should do, including how and who it should alert) are covered in the notification upon events section of the docs, but it can be a lot to process the first time you try set up actions.

          Comment

          Working...