Skip navigation
3294 Views 4 Replies Latest reply: Dec 17, 2010 5:29 AM by moss2k10 RSS
moss2k10 Rank: White Belt 24 posts since
Dec 13, 2010
Currently Being Moderated

Dec 13, 2010 4:45 AM

strange zencommand reactions?

Hello to Everyone!

 

I'm using Zenoss for couple of months now, lately I've integrated it with SMSServerTools for sms notifications. I don't want to talk here about other methods to implement smses. I want to show You something strange: Zenoss is generating proper text messages form for my sms daemon accordingly to simple command showed below:

 

echo -e "To: 48xxxxxxxxx

 

Area: NSN\nTime: ${evt/firstTime}\nType: PROBLEM\nDevice: ${dev/name}\nMessage: ${evt/message}" > /var/spool/sms/outgoing/${evt/evid}_sms_alert

 

Everything is working great with one command defined: when the event is active -> zenoss is creating message -> sms is being send.

Below is my Event command configuration:

 

smsproblem1.jpg

The situation is changing when I create many commands with similar  activation levels - smsalert kwajzmil and smsalert mossapio have the same activation settings:

smsproblem2.jpg

And now the best part: Zenoss is not performing these two enabled commands - only one of them (smsalert mossapio) - when it should create two messages, it creates only one.When I disable one command which is currently working, the second one starts being performed. My first thought was that zenoss isn't able to create two commands in the same time so I changed delay to give him 10 seconds to finish one command but it didn't help.  Any ideas?

 

The problem exists in zenoss 3.0.1 and 2.5.1 versions.

 

Where can I find the log for event commands being performed because zencommand.log doesn't show anything?

 

Thanks for any help in this,

Peter

  • chitambira Rank: Brown Belt 711 posts since
    Oct 15, 2008
    Currently Being Moderated
    1. Dec 14, 2010 8:14 AM (in response to moss2k10)
    Re: strange zencommand reactions?

    the event commands are triggered by a matching event as it comes(or as it is generated)

    a single event triggers the match process and if a match is found, the matching command it then run, no further processing is done.

    [Note that the triggers are primarily filter based, you cant have 2 or more identical filters on different commands, only one will be used]

     

    you would rather put your 2 commands within a single script, then run that script in response to a matching event.

  • chitambira Rank: Brown Belt 711 posts since
    Oct 15, 2008
    Currently Being Moderated
    3. Dec 17, 2010 5:14 AM (in response to moss2k10)
    Re: strange zencommand reactions?

    Like I said, imagine you a new event is generated. the filters will processed and if a match is found, the corresponding event command is run and no further processing. this means if there is another command with an identical filter, that will not be run. For two identical filter, the one that matches first is the one that is run.

    I suggested to use scripts for commands that should be triggered by the same filter. eg.

    if you have two defined commands with exactly same filters:

    * event command - userCom1      command - /usr/bin/send2log.sh ${dev/manageIp} ${bla bla bla...

    * event command - userCom2      command - /usr/bin/text2log.sh ${dev/manageIp} ${bla bla bla...

     

    then you can create a new script called new2log.sh, you put the two above commands into it,

    #!/bin/bash

    /usr/bin/send2log.sh $1 $2 $3 ...

    /usr/bin/text2log.sh $1 $2 $3 ...

     

    where $1, $2 ... up to the number of arguments you have.

     

    then define a single event command:

    * event command - newCom      command - /usr/bin/new2log.sh ${dev/manageIp} ${bla bla bla...

     

    I hope you can easily understand this.

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points