[netsaint] Email notifications

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Sat Dec 28 00:01:00 CET 2002


Dear Sir,

I am writing to thank you for your letter and say that I am forwarding
the reply to nagios-users in case someone else can correct any mistakes
I make or that others may benefit from the correspondence.



On Fri, Dec 27, 2002 at 09:09:46AM -0500, Mike.Hall at eiiecomm.com wrote:
> Stanley,
> Does mail have to be configured on my Netsaint box? 

It depends on where you want the mail sent and how it should be
delivered (SMTP, SMS etc).

If you only want mail delivered 'locally' ie to a user with a login
account on the host running Nagios, No.

Otherwise probably yes.

The first thing to try is send mail to root or postmaster from the CLI
- this is a Linux/Unix installation right ? - on the same box as that
running Netsaint eg

You should see something like this

tsitc> echo 'In the beginning was the word and the word was with GOD' |
mail postmaster

tsitc> tail -2 /var/log/maillog

Dec 28 09:41:34 tsitc sendmail[47835]: gBRMfYD5047835: to=postmaster,
ctladdr=anwsmh (1001/1001), delay=00:00:00, xdelay=00:00:00,
mailer=relay, pri=30016, relay=localhost.aipo.gov.au. [127.0.0.1],
dsn=2.0.0, stat=Sent (gBRMfYm3047836 Message accepted for delivery)

Dec 28 09:41:34 tsitc sendmail[47837]: gBRMfYm3047836: to=root,
ctladdr=<anwsmh at tsitc.aipo.gov.au> (1001/1001), delay=00:00:00,
xdelay=00:00:00, mailer=local, pri=30676, relay=local, dsn=2.0.0,
stat=Sent
tsitc> 

If you see 'Message accepted for delivery' all is well for local
delivery (probably ...). 

Provided that Netsaint notify commands are correct, and you use
'unqualified' email addresses (like 'root', 'postmaster', 'ken' etc), a
notify command like ... mail -s 'yada subject' ken should result in
email being sent to "ken"'s account on the Netsaint host.

If you want non local delivery ie to somewhere else, you need to
configure your MTA.

Here's an example from my Netsaint hosts.cfg with non local delivery

contact[anwsmh]=Stanley
Hopcroft;24x7;24x7;1;1;0;1;1;0;notify-by-email;host-notify-by-email;Stanley at xena

If your MTA is sendmail, then the easiest way to do this is with
mailertables.

eg

tsitc> more /etc/mail/mailertable

IPAustralia.gov.au      esmtp:ipaustralia.gov.au
.                       esmtp:vmail

This means that any mail to Foo at IPAustralia.Gov.AU goes to the MX for IP
Australia, otherwise to a box named Vmail (that knows how to deliver to
any email address).

<rant>

Don't try this at home !!

Do the R&D yourself or hire someone to configure your MTA eg one of the
Nagios/Netsaint professional consultants on the Web pages {that is not
me by the way]

Don't do anything until you are confident that you won't break your
organisations mail system etc

</rant>

>I have tested taking 
> my laptop down and have not received a notification. Any ideas?
> 

Was the 'laptop' being monitored by Netsaint ? (entries in hosts.cfg ..)
Is there a NOTIFY entry in netsaint.log ?
Is there a corresponding entry in maillog ?

> Mike

Yours sincerely.

-- 
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list