Server Staus offline to online -Shell script

Hi,

We put cron entry :whenever server is offline(checks every 5 minutes) it sends status to mailer group.

The number of messages (offline)were growing in our mailbox.How to avoid not to send offline messages after the first one through shell script.

Thanks in advance.

Chowdary

In case of an error let the shell script touch an empty lock file somewhere, maybe /tmp/server_status.lck for example, so it can remember on next check, what former status was. Example:

server offline and no lock file -> new status so touch lock file and send mail
server offline and lock file exists -> do nothing, just a log entry
server online and lock file exists -> delete lock file and send mail that all is ok again
server online and lock file does not exist -> do nothing, just a log entry

Easy to cover with some "if/then/fi" and "else" constructs.

Hi zaxxon,

Thanks for your speedy response.

Regards,
chowdary