Ad Widget

Collapse

How to get X from service_state[X] with macros

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • i.kulagin
    Member
    • Aug 2011
    • 35

    #1

    How to get X from service_state[X] with macros

    Hi all.
    I have a couple of questions. I have zabbix 1.8.6 monitoring some Windows services. I need to create an action, makes these services restart in case of they are stopped/unavailable/etc. So, the remote command is
    net start "SERVICE_NAME"
    And all I need is to put service name from item's key into the macros like this
    service_state[DNS] ==> {MACROS}=DNS
    And create single action with command like
    net start {MACROS}
    insteed of creation multiple commands for every monitored service. Is the macros I need exist? Or should I create my own? If I nedd to create my own one, can anybody please explain me how to do it, cause I haven't found any deep enought explanation of the process in the documentation?
    And another question is if exists 2 sequential remote commands, one after another, and it is supposed that second command should execute only after first has been executed and done is it right way to push them like this
    net stop "SERVICE_NAME"
    net start "SERVICE NAME"
    Or should I make some sort of waiting between the commands:
    net stop "SERVICE_NAME"
    ping -n 5 127.0.0.1 > null
    net start "SERVICE NAME"
    Thx.
    Last edited by i.kulagin; 01-09-2011, 15:12.
  • i.kulagin
    Member
    • Aug 2011
    • 35

    #2
    Any help, guys? Do everybody create action for every single service? No way to make universal action?

    Comment

    • i.kulagin
      Member
      • Aug 2011
      • 35

      #3
      As far as I couldn't find another solution, I used {TRIGGER.COMMENT} macros by filling comment field with a name of windwos service in the certain trigger properties (the triggers which should "shoot" if windows service is down). So the remote command is looks like this: net start {TRIGGER.COMMENT}. It works nice.

      Comment

      Working...