Re: Prefixing the alert subject
On Thu, Nov 03, 2005 at 01:44:21PM -0500, Bill wrote: [about including environment variables in the alert subject] [...] > > In this case, the monitor script won't work properly without MIBDIRS > > defined. You can use this feature to pass environment vars into your > > script, so the same alert script could take different actions or send > > different messages based on the contents of an environment var. > > Yeah, I was hoping that there was already someway to do it without > creating another alert program - I loath re-inventing the wheel so to > speak. But have no problem doing so if it has not been done. I have something like it on my site in our locally modified copy of mail.alert: $desc= $ENV{'MON_DESCRIPTION'} || ""; [...] $ALERT= "ALERT"; $t= localtime($failtime); $downmsg= "Down for $downtime seconds"; $downmsg .= "\n\nNotes: $desc\n" if length($desc); In this case, I'm using the "description" field in the mon config, which is also viewable in the GUI. I use this field for suggestions on what to do if the service goes down, which helps a lot when someone less familar with the system has to handle an alarm at 3 AM. Anyway, this is just straightforward scripting, nothing to be afraid of. If anyone wants, I'll post our mail.alert. It has a bunch of fixes in it for Mon 1.1 compatibility (for new alert types like ackalerts), which should be available soon from a CVS repository near you ___ mon mailing list mon@linux.kernel.org http://linux.kernel.org/mailman/listinfo/mon
Re: Prefixing the alert subject
On Thu, 3 Nov 2005 13:10:18 -0500 Ed Ravin <[EMAIL PROTECTED]> spake: > On Thu, Nov 03, 2005 at 12:12:00PM -0500, Bill wrote: > > > > I have two questions: > > > > I am monitoring from a bunch of systems and would love to have a way > > to have the ALERT on my mail alerts have something defined before or > > after it I can set from the mon.cf file. > > Quick clip from the Mon man page: > > As with monitor programs, alert programs are invoked with environment > variables defined by the user in the service definition, in addition to > the following which are explicitly set by the server: > > Here's an example from one of my configs: > > service freespace > description Is there 5GB free? Enough inodes? > depend SELF:ping > MIBDIRS=/usr/local/share/snmp/local-mibs:/usr/local/share/snmp/mibs > interval 7m > monitor netappfree.monitor > > In this case, the monitor script won't work properly without MIBDIRS > defined. You can use this feature to pass environment vars into your > script, so the same alert script could take different actions or send > different messages based on the contents of an environment var. Yeah, I was hoping that there was already someway to do it without creating another alert program - I loath re-inventing the wheel so to speak. But have no problem doing so if it has not been done. I don't think that which you speak of is in there - so I will just make a new mail alert. Thanks! > > ___ > mon mailing list > mon@linux.kernel.org > http://linux.kernel.org/mailman/listinfo/mon -- Bill Chmura Director of Internet Technology Explosivo ITG Wolcott, CT p: 860.621.8693 e: [EMAIL PROTECTED] w. http://www.explosivo.com ___ mon mailing list mon@linux.kernel.org http://linux.kernel.org/mailman/listinfo/mon
Re: Prefixing the alert subject
On Thu, Nov 03, 2005 at 12:12:00PM -0500, Bill wrote: > > I have two questions: > > I am monitoring from a bunch of systems and would love to have a way > to have the ALERT on my mail alerts have something defined before or > after it I can set from the mon.cf file. Quick clip from the Mon man page: As with monitor programs, alert programs are invoked with environment variables defined by the user in the service definition, in addition to the following which are explicitly set by the server: Here's an example from one of my configs: service freespace description Is there 5GB free? Enough inodes? depend SELF:ping MIBDIRS=/usr/local/share/snmp/local-mibs:/usr/local/share/snmp/mibs interval 7m monitor netappfree.monitor In this case, the monitor script won't work properly without MIBDIRS defined. You can use this feature to pass environment vars into your script, so the same alert script could take different actions or send different messages based on the contents of an environment var. ___ mon mailing list mon@linux.kernel.org http://linux.kernel.org/mailman/listinfo/mon
Prefixing the alert subject and openbsd install tutorial
[sorry to the moderator who has to deal with my post from an unregistered account] Thanks for this program - I've been using it for probably about two years now. In the last few months I've been starting to do more than the basics (dependencies, etc) which has been fun. I have two questions: I am monitoring from a bunch of systems and would love to have a way to have the ALERT on my mail alerts have something defined before or after it I can set from the mon.cf file. So instead of ALERT watchname/server ... I could have CONAME:ALERT watchname/server Where CONAME would be a company / division name / Whatever Obviously I could go in and change the alert.mail code on each monitoring station, but that forks the code. I could also create a new alert.mail alert and use that... Is this something that if its not possible a patch would be accepted for? Should I just modify the alert for mail? My second question / comment is that I have written up a how-to for OpenBSD on getting mon running. It angled at beginners and to get mon some exposure - and I would love some feedback. Its destined for openbsdsupport.org some time soon. http://modok.explosivo.com/~wbchmura/misc/openbsd_mon_install.txt If anyone has suggestions, especially in the area of securing mon as much as possible I would greatly appreciate it. Thanks much, have a great day -- Bill Chmura Director of Internet Technology Explosivo ITG Wolcott, CT p: 860.621.8693 e: [EMAIL PROTECTED] w. http://www.explosivo.com -- Bill Chmura Director of Internet Technology Explosivo ITG Wolcott, CT p: 860.621.8693 e: [EMAIL PROTECTED] w. http://www.explosivo.com ___ mon mailing list mon@linux.kernel.org http://linux.kernel.org/mailman/listinfo/mon