Hello,
What I want to do is to run a script every 5 min. let's say. What the script actually does is to ping some hosts and if the host does not reply send an email to me.
If i just run the script "/usr/bin/script" it works perfectly. The script is 777 chmod-ed.
I've added in crontab something like:
Code:
*/5 * * * * /usr/bin/netpoint_mon
also I've tried:
Code:
*/5 * * * * /usr/bin/netpoint_mon 2>&1
But it doesn't send any mail like this.
Also I've tried (with no result):
Code:
* * * * * /usr/bin/netpoint_mon
* * * * * /usr/bin/netpoint_mon 2>&1
Also the scripts generates some logs. With the line:
Code:
*/5 * * * * /usr/bin/netpoint_mon
new entries are added to the log files but no mail is sent. In addition to that if I do a "sendmail -bp" i get "-- 3696 Kbytes in 588 Requests."
All of the requests look something like this:
Code:
87ED07A489D 6952 Wed Dec 19 20:40:11 user@host.com
(delivery temporarily suspended: connect to mail.rdsnet.ro[193.231.236.16](This is my smtp): Connection timed out)
user@host.com
it says "Connection timed out" but if i run the script manually it sends all the emails as expected.
What am I doing wrong ? Thanks.