Skip navigation
2731 Views 7 Replies Latest reply: Aug 15, 2012 9:10 AM by kkearney RSS
Jordan Phil Newbie 4 posts since
May 22, 2012
Currently Being Moderated

May 30, 2012 9:24 AM

Daily Reminder (ongoing events)

Hi I was taking a look at all the zen packs that are on the site but didn't have any luck finding what i was looking for.

 

I am looking for a ongoing critical events email. I love how zenoss sends you an email, mine is set up for critical events to be emailed to me. Zenoss only seems to email you when the event triggers. I am looking for an events ongoing zenpack. So every day at a certain time it sends me an email with all critical events or above.

 

Could anyone give me a starting point in coding this or if they know of a code avaliabe to please share?  I am not a coder but willing to take sometime to learn python to make this happen. Thanks

  • dpetzel Rank: Brown Belt 1,141 posts since
    Oct 17, 2010
    Currently Being Moderated
    2. Jun 19, 2012 8:49 PM (in response to Jordan Phil)
    Re: Daily Reminder (ongoing events)

    This shouldnt to insanely complicated to write. I believe you should be able to leverage the JSON API and the Event router to fetch a list of open events.

  • kkearney ZenossEmployee 118 posts since
    Sep 23, 2008
    Currently Being Moderated
    3. Aug 13, 2012 9:56 PM (in response to Jordan Phil)
    Re: Daily Reminder (ongoing events)

    I will suggest that you find a report that looks close to what you want to have, copy + update it, and then use reportmail to send out the result.

     

     

    kells

  • jcurry ZenossMaster 1,021 posts since
    Apr 15, 2008
    Currently Being Moderated
    4. Aug 14, 2012 1:56 AM (in response to kkearney)
    Re: Daily Reminder (ongoing events)

    Kells - can reportmail cope with a report where you need to provide input??  I was trying this idea yesterday with a report I have written but, rather like the standard Availability report, I need to provide selection criteria to determine the output of the report.

     

    Any way to provide that in reportmail?

     

    Many thanks,

    Jane

  • kkearney ZenossEmployee 118 posts since
    Sep 23, 2008
    Currently Being Moderated
    5. Aug 14, 2012 8:28 AM (in response to jcurry)
    Re: Daily Reminder (ongoing events)

    Jane! How's the Olympics treating you? 

     

     

      The reports behave like CGI pages, so you can pass in arguments to them.  For instance, for the CPU Utilization report:

     

    $ reportmail -u 'http://localhost:8080/zport/dmd/Reports/Performance\%20Reports/CPU\%20Utilization?deviceClass=/Devices/Network' -U admin -p zenoss -s "My Daily Report" -a myemail@example.com

     

      Of course, you'll need to read the .rpt file to find out the names of the variables (ugh!).  It's the same process that you would need to do to run the $ZENHOME/Products/ZenReports/ReportRunner.py script to get CSV output.

     

      There's definitely room for improvement in the process (and a few less than ideal behaviours), but it mostly works relatively sanely.

     

     

    kells

  • jcurry ZenossMaster 1,021 posts since
    Apr 15, 2008
    Currently Being Moderated
    6. Aug 14, 2012 4:09 PM (in response to kkearney)
    Re: Daily Reminder (ongoing events)

    Hi Kells,

    The Olympics worked reallly well for us!

     

    I get you on the way to provide parameters but the value of my parameter is a fully-qualified domain name - with dots in it.  The report seems to have replaced all my dots with slashes so the hostname doesn't match   Any good ideas?  I have tried escaping the dots with backslash and tried putting single quotes around everything but no joy.

     

    Also, do I need to specify the submit box as a parameter???

     

    And if I want to specify several input fields, what is the separator between them?

     

    Many thanks & best regards,

    Jane

  • kkearney ZenossEmployee 118 posts since
    Sep 23, 2008
    Currently Being Moderated
    7. Aug 15, 2012 9:10 AM (in response to jcurry)
    Re: Daily Reminder (ongoing events)

    The Olympics worked reallly well for us!

     

    Past tense, right.  Doh!

     

     

    I get you on the way to provide parameters but the value of my parameter is a fully-qualified domain name - with dots in it. The report seems to have replaced all my dots with

    slashes so the hostname doesn't match Any good ideas? I have tried escaping the dots with backslash and tried putting single quotes around everything but no joy.

     

    That's just plain weird, and that is a new one on me.  The hex code for a period is 2E, so I'll suggest to add a \%2E where the periods would be.

    That might work.

     

     

    Also, do I need to specify the submit box as a parameter???

     

    Nope.

     

     

    And if I want to specify several input fields, what is the separator between them?

     

    The regular CGI separator of '&' (which will need to be escaped on the command-line, of course ).

     

     

    kells

More Like This

  • Retrieving data ...

Legend

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