Ad Widget

Collapse

Is there a way to manually fire a trigger from command line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rohan8594
    Junior Member
    • Jun 2018
    • 3

    #1

    Is there a way to manually fire a trigger from command line

    Hi guys,

    Currently I have an external check configured as an item and I use a simple condition in my trigger that checks if the output of my external script is 0 or 1. If I get 1, my trigger goes into PROBLEM state and I send an email alert. So far I've been using a very hacky approach to test the email notifications wherein I make a minor edit to my external script every single time such a way that the trigger gets fired and in turn the email gets sent. My question is, is there a way to toggle the trigger from command line which will in turn will call an action and then send the email?
  • kernbug
    Senior Member
    • Feb 2013
    • 330

    #2
    Originally posted by rohan8594
    Hi guys,

    Currently I have an external check configured as an item and I use a simple condition in my trigger that checks if the output of my external script is 0 or 1. If I get 1, my trigger goes into PROBLEM state and I send an email alert. So far I've been using a very hacky approach to test the email notifications wherein I make a minor edit to my external script every single time such a way that the trigger gets fired and in turn the email gets sent. My question is, is there a way to toggle the trigger from command line which will in turn will call an action and then send the email?
    Hi,

    Examples:
    1. Add another item with Zabbix trapper type and link it with the same Action, use zabbix_sender to send desired value. But in this case you don't be able to test script logic, only Action/Alert from Zabbix Server.
    2. Add additional check to your external script, something like: "if file in /tmp/mail.test exists - return 1".

    Comment

    • rohan8594
      Junior Member
      • Jun 2018
      • 3

      #3
      Originally posted by kernbug

      Hi,

      Examples:
      1. Add another item with Zabbix trapper type and link it with the same Action, use zabbix_sender to send desired value. But in this case you don't be able to test script logic, only Action/Alert from Zabbix Server.
      2. Add additional check to your external script, something like: "if file in /tmp/mail.test exists - return 1".
      Thanks!, the first example worked. I was trying to use zabbix_sender previously but I didn't realize that the item had to be a zabbix trapper type to make it work. Thanks for pointing it out.

      Comment

      Working...