Follow

How To Send Or Save A Report Regularly

Applies To

  • Zenoss 4.x
  • Zenoss 3.1.x
  • Zenoss 3.0.x
  • Zenoss 2.5.x

Summary

Some users may find it is necessary to archive or send a report on a regular basis. Below are 2 different ways to accomplish this task.

Procedure

Method 1 - reportmail

Zenoss comes with a command-line tool called reportmail that can send a report via email from Zenoss. One way of automating a report on a daily, weekly, or monthly basis is to set up a cron job to send the same report for that interval. The format of the reportmail command is:

    
reportmail -u *URLofReport* -U *zenossUsername* -p *zenossPassword* -a *yourEmailAddress*

To automate this, run crontab -e as the zenoss user to put the command in as a cron job. For example, if you wanted to email the "Alert Rule Email Addresses" report daily at 5:00am, you would put the following in your crontab (note that percent signs (%) must be escaped with a backslash '\'):

    
0 5 * * * bash -lc 'reportmail -u http://my.zenoss.instance:8080/zport/dmd/Reports/Enterprise\%20Reports/Alert\%20Rule\%20Email\%20Addresses -U admin -p mypassword -a myemail@company.com'

Method 2 - wget

The wget command can be used to save a copy of the report to a specific location, which can be automated using cron. Your wget command would look like:

wget --http-user=*zenossUsername* --http-password=*zenossPassword* *URLofReport*

To automate this, run crontab -e as the zenoss user to put the command in as a cron job. For example, if you wanted to save the "Alert Rule Email Addresses" report every hour, you would put the following in your crontab (note that percent signs (%) must be escaped with a backslash '\'):

0 * * * * wget -O /opt/zenoss/reports/AlertEmailReport --http-user=admin --http-password=mypassword http://my.zenoss.instance:8080/zport/dmd/Reports/Enterprise\%20Reports/Alert\%20Rule\%20Email\%20Addresses

If you wanted to save The "Alert Rule Email Addresses" report daily under a unique name that included the date for historical purposes, you could put the following in your crontab (note that percent signs (%) must be escaped with a backslash '\'):

0 0 * * * wget -O /opt/zenoss/reports/AlertEmailReport.`date +\%Y\%m\%d` --http-user=admin --http-password=mypassword http://my.zenoss.instance:8080/zport/dmd/Reports/Enterprise\%20Reports/Alert\%20Rule\%20Email\%20Addresses
Was this article helpful?
0 out of 0 found this helpful

Comments

  • Avatar
    Pallavi

    hi all,
    The file is saved in which format ??

  • Avatar
    Pallavi

    how to read the file saved

Powered by Zendesk