Ok, I have just implemented "remote alerts" in the past few days.
Try this.
In your mon config set up two new watches:
watch default
service default
period wd {Sun-Sat}
alert mail.alert [EMAIL PROTECTED]
watch pr-internet
service http_tp
period wd {Sun-Sat}
alert mail.alert [EMAIL PROTECTED]
Restart or SIGHUP mon so that it reads the new config file.
Then, from a remote machine run remote.alert (in the alert.d directory),
where yourmon.mon.com is your mon machine.
./remote.alert -H yourmon.mon.com
Summary line
Detail line 1
Detail line 2
^D
This should trigger a "default" alarm on the mon machine. Now, if you want
the alarm to hit the pr-internet / http_tp watch / service then do:
./remote.alert -H yourmon.mon.com -g pr-internet -s http_tp
Summary line
Detail line 1
Detail line 2
^D
So, your asynchronous event generating program could run remote.alert, or
you could incorporate its functionality in your program.
Jon
On Tue, 7 Aug 2001, Kevin Handy wrote:
> Ed Ravin wrote:
> >
> > Kevin Handy writes:
> > >
> > > Does someone have an example of using asynchronous events to
> > > trigger mon to send an alert? I have programs monitoring serial
> > > lines and would like it to trigger mon when problems are indicated
> > > via messages on the serial line. The program monitoring the serial
> > > lines can't be run at intervals like the monitors, because it would
> > > likely miss the messages.
> >
> > Check the mon list archives and search for "traps" - that's the feature
> > you want. This feature is still in development, but it can be made
> > to work.
>
> I've looked at the archive, and all I could spot was messages saying
> it existed, and others asking for examples, but no examples or
> any solid information on how to use it.
>
> Any examples or documentation of this feature? Even a simple
> "run this program, and it will immediately log a message" would help.