Sendmail Configuration

Hi,

We have a standalone Solaris 10 Server (no DNS is configured) from which we want email alerts to be triggered when there is any breaches in the disk utilization threshold levels. we would like to achieve this mailing through sendmail.

Can any one explain the procedure to do so..???

thanks in advance.

As far as monitoring the specific condition, you might find it better to install something like Zabbix (which UNIX.com uses) or Nagios or rrdtool or something like that. Solaris also has great support for snmp, which supports custom triggers.. Then an snmp agent can monitor the system and alert you.

To get sendmail running without DNS, you use a "null" or "MSP" only configuration -- as long as you have a mail hub that it can direct mails to, this works fine. Search these forums for that answer, since mine is based on BSD Sendmail 8.x and yours is quite different.

But if you need something quick, this should do:

 FILESYSTEM=/var
 MINKBFREE=4096   # 4 MB
 while df -b $FILESYSTEM | awk 'NR==2 && $2 < int(minfree) { exit(1) }' minfree=$MINKBFREE
 do sleep 60;  done

 df $FILESYSTEM |
 /usr/lib/sendmail -s "Disk full alert" administrator@myorg.internal.host.server 

It will exit after this and you'll need to re-start it manually.