Discussion:
Reportsmail not sending report when using cron.
Greg Lucas
2013-06-26 18:46:41 UTC
Permalink
Greg Lucas [http://community.zenoss.org/people/gregoryjlucas] created the discussion

"Reportsmail not sending report when using cron."

To view the discussion, visit: http://community.zenoss.org/message/73766#73766

--------------------------------------------------------------
Hi,

I've encounted an issue where I have a bash script that I can run on the command line and this will generate the report and email it to a distro list I have setup.  On the other hand if I run it via cron, logs say it runs but never sends the email. 

Here's the script:
[***@localhost ~]$ cat emailAvailabilityReport.sh
#!/bin/sh
ZENOSS_ENV=~zenoss/.bashrc
REPORTS_URL=" http://xxx.xxx.xxx.xxx:8080/zport/dmd/reports#reporttree:.zport.dmd.Reports.Performance http://xxx.xxx.xxx.xxx:8080/zport/dmd/reports#reporttree:.zport.dmd.Reports.Performance Reports.Availability Report"


$ZENHOME/bin/reportmail \
--user=admin \
--passwd=XXXXXXX \
--from=" mailto:***@XXXXXX.com ***@XXXXXX.com" \
--address=" mailto:***@XXXXX.com ***@XXXXX.com" \
--subject="Zenoss: Availability Report" \
--url="$REPORTS_URL/Performance Reports/Availability Report"


Here's the cron job I have setup (for output):
[***@localhost ~]$ crontab -l
* 17 * * * /home/zenoss/emailAvailabilityReport.sh >> /home/zenoss/zenossreport.log


Cron shows at it actually being called in the logs:
Jun 25 17:59:01 localhost crond[31739]: (zenoss) CMD (/home/zenoss/emailAvailabilityReport.sh >> /home/zenoss/zenossreport.log)


Checked to make sure I have the right path to run it:
[***@localhost ~]$ ls -la /home/zenoss/emailAvailabilityReport.sh
-rwxrwxr-x 1 zenoss zenoss 399 Jun 25 17:08 /home/zenoss/emailAvailabilityReport.sh

This is rather maddening so any help would be appreciated.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/73766#73766]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Rob Eagle
2013-06-26 19:40:19 UTC
Permalink
Rob Eagle [http://community.zenoss.org/people/reagle] created the discussion

"Re: Reportsmail not sending report when using cron."

To view the discussion, visit: http://community.zenoss.org/message/73757#73757

--------------------------------------------------------------
Hey Greg,
not sure if it is the cron, but here is how ours looks:
0 0 * * 1 bash -lc '$ZENHOME/scripts/weeklyDSL.sh'

If this doesn't work, will attach what our weeklyDSL.sh looks like and maybe that will help.
--Rob
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/73757#73757]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Greg Lucas
2013-06-26 23:01:01 UTC
Permalink
Greg Lucas [http://community.zenoss.org/people/gregoryjlucas] created the discussion

"Re: Reportsmail not sending report when using cron."

To view the discussion, visit: http://community.zenoss.org/message/73771#73771

--------------------------------------------------------------
That worked, thanks much!
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/73771#73771]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...