Discussion:
Reportmail Problem
Patrick Ermer
2012-11-06 14:44:39 UTC
Permalink
Patrick Ermer [http://community.zenoss.org/people/pt1xoom] created the discussion

"Reportmail Problem"

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

--------------------------------------------------------------
Hello,

I am having problems with reportmail function.  Here is my script, which seems like a pretty simple script.  When I run it manually, the report is emailed to me.  When I set up a cron job on the crontab, the script is run, but I do not receive the email.  I know the script is running because I output it to a file.

Any ideas why this script will email correctly when run manually, but not when it is run under crontab?  I am running Ubuntu 12.04.  This might be an Ubuntu confige problem vs a Zenoss confige problem, but I thought I would start here.

#!/bin/sh
echo "email_reports.sh started "
date


$ZENHOME/bin/reportmail --user=xxxx --passwd=xxxx --from="***@xxxx" --address="***@xxxx" --subject="Zenoss Report: xxxx"  --url=" http://xxxx:8080/zport/dmd/Reports/Graph%20Reports/xxxxx http://xxxx:8080/zport/dmd/Reports/Graph%20Reports/xxxxx"
--------------------------------------------------------------

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

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
hydruid
2012-11-08 02:42:48 UTC
Permalink
hydruid [http://community.zenoss.org/people/hydruid] created the discussion

"Re: Reportmail Problem"

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

--------------------------------------------------------------
Patrick,

Are you running the script manually and in crontab as the same user?

You might also try specifying the $ZENHOME manually to the actual path, example:

#!/bin/sh
echo "email_reports.sh started "
date


/usr/local/zenoss/bin/reportmail --user=xxxx --passwd=xxxx --from="***@xxxx" --address="***@xxxx" --subject="Zenoss Report: xxxx"  --url=" http://xxxx:8080/zport/dmd/Reports/Graph%20Reports/xxxxx http://xxxx:8080/zport/dmd/Reports/Graph%20Reports/xxxxx"
--------------------------------------------------------------

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

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Patrick Ermer
2012-11-08 14:29:09 UTC
Permalink
Patrick Ermer [http://community.zenoss.org/people/pt1xoom] created the discussion

"Re: Reportmail Problem"

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

--------------------------------------------------------------
Thank you very much.  I made two changes, so I'm not sure which change worked.

1. I replaced $ZENHOME in the script and in the crontab to the actaul locations.
2. I changed the permissions on reportmail.  It was set that only the zenoss user had access.  I changed it to 755.

Now the reports are coming through.
--------------------------------------------------------------

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

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
hydruid
2012-11-08 14:36:09 UTC
Permalink
hydruid [http://community.zenoss.org/people/hydruid] created the discussion

"Re: Reportmail Problem"

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

--------------------------------------------------------------
Glad to hear you have it working!
--------------------------------------------------------------

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

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