mon-commit Mailing List for mon (Page 6)
Brought to you by:
trockij
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(36) |
Jul
(21) |
Aug
(9) |
Sep
(1) |
Oct
(2) |
Nov
(12) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(4) |
Feb
(10) |
Mar
(5) |
Apr
(22) |
May
(17) |
Jun
(3) |
Jul
(4) |
Aug
(10) |
Sep
(2) |
Oct
(1) |
Nov
(2) |
Dec
(2) |
2006 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
(6) |
Oct
|
Nov
|
Dec
(2) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(22) |
Jun
(19) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2008 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
(7) |
Nov
(1) |
Dec
|
2009 |
Jan
(2) |
Feb
(9) |
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2010 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(2) |
Jul
(65) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jim T. <tr...@us...> - 2007-06-25 13:27:36
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12235 Modified Files: Tag: mon-1-2-branch INSTALL Log Message: readme Index: INSTALL =================================================================== RCS file: /cvsroot/mon/mon/INSTALL,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** INSTALL 25 Jun 2007 13:10:05 -0000 1.2.2.2 --- INSTALL 25 Jun 2007 13:27:29 -0000 1.2.2.3 *************** *** 72,78 **** All of the monitor and alert scripts that are packaged with mon are actually ! optional in that it will only use the monitors which you have specified in your ! configuration. There is no need to install any extra dependencies, such as Perl ! modules, for monitors which you will not be using. You may test to see if a monitor works outside of mon by simply running it from --- 72,78 ---- All of the monitor and alert scripts that are packaged with mon are actually ! optional in that mon will only use the monitors which you have specified in ! your configuration. There is no need to install any extra dependencies, such as ! Perl modules, for monitors which you will not be using. You may test to see if a monitor works outside of mon by simply running it from *************** *** 87,92 **** -------------------------------------------------------------------------- reachable hosts rtt ! --------------------------------------------------------------------------- ! uplift 0.07 ms Some monitors may need Perl modules which may not already be installed on your --- 87,92 ---- -------------------------------------------------------------------------- reachable hosts rtt ! -------------------------------------------------------------------------- ! uplift 0.07 ms Some monitors may need Perl modules which may not already be installed on your *************** *** 125,131 **** insight on system configuration. - -Be sure you have the required Perl modules, which are listed in this - file. - -Make your own mon.cf file, using the suppled "example.cf" (located in the etc/ directory) as a template, or the m4-based "example.m4": --- 125,128 ---- |
From: Jim T. <tr...@us...> - 2007-06-25 13:10:47
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31586 Modified Files: Tag: mon-1-2-branch INSTALL README Log Message: updated docs Index: README =================================================================== RCS file: /cvsroot/mon/mon/README,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** README 3 Jun 2007 13:08:58 -0000 1.3.2.1 --- README 25 Jun 2007 13:10:05 -0000 1.3.2.2 *************** *** 61,66 **** ------------ ! The latest release of mon is available from kernel.org ! in pub/software/admin/mon/. Please choose a mirror from http://www.kernel.org/mirrors/ --- 61,66 ---- ------------ ! The latest release of mon is available from kernel.org in ! /pub/software/admin/mon/. Please choose a mirror from: http://www.kernel.org/mirrors/ *************** *** 75,85 **** CVS trees of both the development trunk and stable release branches are ! available from anonymous CVS access on sourceforge.net. To check out the latest ! stable branch, do the following: ! $ cvs -d:pserver:ano...@cv...:/cvsroot/mon login ! $ cvs -z3 -d:pserver:ano...@cv...:/cvsroot/mon co -r mon-1-0-0pre1 mon - The "development" branch may be checked out by omitting the "-r mon-1-0-0pre1". --- 75,83 ---- CVS trees of both the development trunk and stable release branches are ! available from anonymous CVS access on sourceforge.net. To check out the ! latest, see: ! http://mon.wiki.kernel.org/index.php/Development *************** *** 91,94 **** ---------- ! Jim Trocki ! tr...@ar... --- 89,95 ---- ---------- ! Jim Trocki <tr...@ar...> ! Software Engineer ! Linux Systems Group ! Unisys ! Malvern, PA Index: INSTALL =================================================================== RCS file: /cvsroot/mon/mon/INSTALL,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** INSTALL 11 May 2007 01:00:25 -0000 1.2.2.1 --- INSTALL 25 Jun 2007 13:10:05 -0000 1.2.2.2 *************** *** 40,49 **** ------------------------------------ ! The Perl client module is distributed as a separate package. It is named ! "mon-client-*.tar.gz". Refer to that for installation instructions. ! It is available on kernel.org mirrors in the /pub/software/admin/mon directory, ! and in CVS on sourceforge.net. Be sure to match the version of mon-client with ! the version of mon you are using. At this time, branch "mon-1-0-0pre1" of the ! mon CVS module matches the "mon-client-1-0-0pre1" branch of the mon-client CVS module. See http://sourceforge.net/projects/mon/ for information on CVS access. --- 40,50 ---- ------------------------------------ ! The Perl client module is distributed as a separate package, and is required ! for the web interfaces "mon.cgi" and "monshow" and for "moncmd". It is named ! "mon-client-*.tar.gz". Refer to that for installation instructions. It is ! available on kernel.org mirrors in the /pub/software/admin/mon directory, and ! in CVS on sourceforge.net. Be sure to match the version of mon-client with the ! version of mon you are using. At this time, branch "mon-1-2-branch" of the mon ! CVS module matches the "mon-client-1-2-branch" branch of the mon-client CVS module. See http://sourceforge.net/projects/mon/ for information on CVS access. *************** *** 70,114 **** ----------- ! All of the monitor and alert scripts that are packaged with mon are ! actually *optional*. However, this is what you'll need for each special ! monitor, with CPAN paths relative to /cpan/modules/by-author/id/ ! freespace.monitor - requires Filesys::Diskspace from CPAN, ! in FTASSIN/Filesys-DiskSpace-0.05.tar.gz ! ! fping.monitor - requires the 'fping' binary, from http://www.fping.com ! RPM packages available at http://dag.wieers.com/packages/fping/ ! telnet.monitor - requires the Net::Telnet from CPAN, ! in J/JR/JROGERS/Net-Telnet-3.03.tar.gz ! reboot.monitor ! asyncreboot.monitor ! netappfree.monitor ! process.monitor ! hpnp.monitor ! Use the 'net-snmp' package (formerly UCD SNMP), from ! http://sourceforge.net/projects/net-snmp ! with G.S. Marzot's Perl module G/GS/GSM/SNMP-4.2.0.tar.gz ! ldap.monitor - requires Net::LDAPapi from CPAN, ! CDONLEY/Net-LDAPapi-1.42.tar.gz ! dialin.monitor - requires the Perl Expect module from CPAN, ! R/RG/RGIERSIG/Expect-1.15.tar.gz ! dns.monitor - requires Net::DNS from CPAN, ! C/CR/CREIN/Net-DNS-0.47.tar.gz ! msql-mysql.monitor ! requires the MSQL/MySQL DBD module and DBI front-end. - There are a good number of useful monitors included which are not listed - above, so please take the time to read doc/README.monitors to get the - details. 5. MON.CF CUSTOMIZATION AND STARTUP ----------------------------------- -Read the man page for "mon" and "moncmd" in the doc/ directory to get an overview of the directories involved, i.e. the configuration, --- 71,118 ---- ----------- ! All of the monitor and alert scripts that are packaged with mon are actually ! optional in that it will only use the monitors which you have specified in your ! configuration. There is no need to install any extra dependencies, such as Perl ! modules, for monitors which you will not be using. ! You may test to see if a monitor works outside of mon by simply running it from ! the command line, giving it a host as an argument. For example: ! $ ./fping.monitor uplift ! start time: Mon Jun 25 07:52:34 2007 ! end time : Mon Jun 25 07:52:34 2007 ! duration : 0 seconds ! -------------------------------------------------------------------------- ! reachable hosts rtt ! --------------------------------------------------------------------------- ! uplift 0.07 ms ! Some monitors may need Perl modules which may not already be installed on your ! system. To determine if you have the requisite modules installed, you can pass ! the monitor to "perl -c" and see if it says "OK", like this: ! $ perl -c fping.monitor ! fping.monitor syntax OK ! If it gripes about "Can't locate...", then what follows are the modules which ! you'll need to install from CPAN. ! ! Monitors may have their own embedded documentation at the top, and some ! may provide their own POD (viewable with "pod2man xyz.monitor | nroff -man"). ! There may also be some additional documentation on some monitors in the "doc" ! directory of the root of the tarball. 5. MON.CF CUSTOMIZATION AND STARTUP ----------------------------------- + -You may want to begin learning about mon by following the slides from the + presentation. They cover the components, what they do, how they relate, and + how it all works together. Find them here: + + http://mon.wiki.kernel.org/index.php/Documentation + -Read the man page for "mon" and "moncmd" in the doc/ directory to get an overview of the directories involved, i.e. the configuration, |
From: Jim T. <tr...@us...> - 2007-06-25 13:10:19
|
Update of /cvsroot/mon/mon/etc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31586/etc Modified Files: Tag: mon-1-2-branch example.cf Log Message: updated docs Index: example.cf =================================================================== RCS file: /cvsroot/mon/mon/etc/example.cf,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.4.1 *** example.cf 9 Jun 2004 05:18:06 -0000 1.1.1.1 --- example.cf 25 Jun 2007 13:10:08 -0000 1.1.1.1.4.1 *************** *** 5,10 **** # # ! # This works with 0.38pre8 # --- 5,16 ---- # + # Please read the mon.8 manual page! # ! # NOTE: ! # ! # A "watch" definition (a line which begins with the word "watch" and is ! # followed by "service" definitions) is terminated by an ! # empty line, or by a subsequent definition. You may not put blank lines ! # inside of your watch definitions. # |
From: Jim T. <tr...@us...> - 2007-06-25 13:10:13
|
Update of /cvsroot/mon/mon/doc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31586/doc Modified Files: Tag: mon-1-2-branch mon.8 Log Message: updated docs Index: mon.8 =================================================================== RCS file: /cvsroot/mon/mon/doc/mon.8,v retrieving revision 1.6.2.2 retrieving revision 1.6.2.3 diff -C2 -d -r1.6.2.2 -r1.6.2.3 *** mon.8 3 Jun 2007 13:08:59 -0000 1.6.2.2 --- mon.8 25 Jun 2007 13:10:07 -0000 1.6.2.3 *************** *** 555,561 **** .SH CONFIGURATION FILE ! The configuration file consists of zero or more hostgroup definitions, and one or more watch definitions. Each watch definition may have one ! or more service definitions. A line beginning with optional leading whitespace and a pound ("#") is regarded as a comment, and is ignored. --- 555,563 ---- .SH CONFIGURATION FILE ! The configuration file consists of zero or more global variable definitions, ! zero or more hostgroup definitions, and one or more watch definitions. Each watch definition may have one ! or more service definitions. A watch definition is terminated by a blank ! line, another definition, or the end of the file. A line beginning with optional leading whitespace and a pound ("#") is regarded as a comment, and is ignored. *************** *** 567,570 **** --- 569,582 ---- single line. + Typically the configuration file has the following layout: + + 1. Global variable definitions + + 2. Hostgroup definitions + + 3. Watch definitions + + See the "etc/example.cf" file which comes for the distribution for an example. + .SS "Global Variables" The following variables may be set to override compiled-in *************** *** 991,998 **** Watch entries consist of one or more service definitions. ! There is a special watch group entry called "default". If a ! default watch group is defined with a "default" service entry, ! then this definition will be used in handling unknown mon ! traps. .SS "Service Definitions" --- 1003,1013 ---- Watch entries consist of one or more service definitions. ! A watch group is terminated by a blank line, the end of the file, or by a ! subsequent definition, "watch", "hostgroup", or otherwise. ! ! There may be a special watch group entry called "default". If a ! default watch group is defined with a service entry named "default", ! then this definition will be used in handling traps received for ! an unrecognized watch and service. .SS "Service Definitions" |
From: Jim T. <tr...@us...> - 2007-06-25 13:10:13
|
Update of /cvsroot/mon/mon/mon.d In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31586/mon.d Removed Files: Tag: mon-1-2-branch http_tp.monitor Log Message: updated docs --- http_tp.monitor DELETED --- |
From: Jim T. <tr...@us...> - 2007-06-25 13:09:30
|
Update of /cvsroot/mon/mon-client In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30626 Modified Files: Tag: mon-client-1-2-branch CHANGES README Removed Files: Tag: mon-client-1-2-branch .monperl.prcs_aux Log Message: updated readme Index: README =================================================================== RCS file: /cvsroot/mon/mon-client/README,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.4.1 *** README 18 Jun 2004 14:25:16 -0000 1.1.1.1 --- README 25 Jun 2007 13:09:24 -0000 1.1.1.1.4.1 *************** *** 5,15 **** This is the Perl5 module for interfacing with the Mon system monitoring ! package. Currently only the client interface is implemented, but more ! things like special logging routines and persistent monitors are being ! considered. "mon" is a tool for monitoring the availability of services. More information can be found at http://www.kernel.org/software/mon/ - and https://sourceforge.net/projects/mon/. To install: --- 5,14 ---- This is the Perl5 module for interfacing with the Mon system monitoring ! package. It is intended to be used in conjuction with the mon 1.2.x server. ! Currently only the client interface is implemented, but more things like ! special logging routines and persistent monitors are being considered. "mon" is a tool for monitoring the availability of services. More information can be found at http://www.kernel.org/software/mon/ To install: *************** *** 23,30 **** make install ! ! Jim Trocki ! Computer System and Network Engineer ! Transmeta Corporation ! Santa Clara, CA ! tr...@tr... --- 22,28 ---- make install ! Jim Trocki <tr...@ar...> ! Software Engineer ! Linux Systems Group ! Unisys ! Malvern, PA --- .monperl.prcs_aux DELETED --- Index: CHANGES =================================================================== RCS file: /cvsroot/mon/mon-client/CHANGES,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.4.1 *** CHANGES 18 Jun 2004 14:25:15 -0000 1.1.1.1 --- CHANGES 25 Jun 2007 13:09:19 -0000 1.1.1.1.4.1 *************** *** 4,7 **** --- 4,15 ---- CHANGELOG + Mon Jun 25 09:08:37 EDT 2007 + ---------------------------- + + For use with mon-1.2.x, see: + + http://www.kernel.org/software/mon/ + + Differences between 0.9901 and 1.0000: Fri Jun 18 09:38:01 EDT 2004 |
From: Jim T. <tr...@us...> - 2007-06-06 11:46:29
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14418 Modified Files: Tag: mon-1-2-branch CHANGES mon Log Message: fixed 'disable host' behavior reported by ed ravin Index: CHANGES =================================================================== RCS file: /cvsroot/mon/mon/CHANGES,v retrieving revision 1.3.2.11 retrieving revision 1.3.2.12 diff -C2 -d -r1.3.2.11 -r1.3.2.12 *** CHANGES 3 Jun 2007 20:07:16 -0000 1.3.2.11 --- CHANGES 6 Jun 2007 11:46:17 -0000 1.3.2.12 *************** *** 2,6 **** Changes between mon-1.2.0- and mon-1.2.0-release ! Thu May 10 20:59:34 EDT 2007 ----------------------------------------------- --- 2,6 ---- Changes between mon-1.2.0- and mon-1.2.0-release ! Wed Jun 6 07:45:35 EDT 2007 ----------------------------------------------- *************** *** 49,52 **** --- 49,62 ---- by Jon Meek + -fixed "disable host" behavior. if a host was the only member of a hostgroup, + that watch would be disabled, but that host would not be disabled in other + hostgroups. the correct behavior is that a host will be disabled individually + in all hostgroups, and if it is the only memeber of a hostgroup, the watch + associated with that hostgroup will be disabled. enabling the host again undoes + all of that. the behavior of disabling the watch is useful so that disabling a + host in a single-hosted hostgroup does not inadvertently leave an empty + hostgroup, which will generate log warnings when services are run against it. + reported by Ed Ravin + Changes between mon-1.0.0pre3 and mon-1.0.0pre4 Index: mon =================================================================== RCS file: /cvsroot/mon/mon/mon,v retrieving revision 1.22.2.1 retrieving revision 1.22.2.2 diff -C2 -d -r1.22.2.1 -r1.22.2.2 *** mon 3 May 2007 19:41:24 -0000 1.22.2.1 --- mon 6 Jun 2007 11:46:19 -0000 1.22.2.2 *************** *** 2887,2910 **** } ! if (@notfound == 0) { foreach my $h (@hosts) { ! if (my $g=host_singleton_group($h) ) { disen_watch($g, 0); - $stchanged++; mysystem("$CF{MONREMOTE} disable watch $g") if ($CF{MONREMOTE}); - } else { - disen_host ($h, 0); - $stchanged++; - mysystem("$CF{MONREMOTE} disable host $h") if ($CF{MONREMOTE}); } } sock_write ($fh, "220 disable host completed\n"); } - else - { - sock_write ($fh, "520 disable host failed, @notfound does not exist\n"); - } } else { --- 2887,2915 ---- } ! if (@notfound) ! { ! sock_write ($fh, "520 disable host failed, host(s) @notfound do not exist\n"); ! } ! ! else { foreach my $h (@hosts) { ! # ! # disable a watch if there is a group with this host ! # as its only member. this prevents warning messages ! # about monitors not being run on empty host groups ! # ! foreach my $g (host_singleton_group($h)) { disen_watch($g, 0); mysystem("$CF{MONREMOTE} disable watch $g") if ($CF{MONREMOTE}); } + + disen_host ($h, 0); + $stchanged++; + mysystem("$CF{MONREMOTE} disable host $h") if ($CF{MONREMOTE}); } sock_write ($fh, "220 disable host completed\n"); } } else { *************** *** 2912,2916 **** } - # # enable watch, service or host --- 2917,2920 ---- *************** *** 2951,2963 **** } elsif ($cmd eq "host") { foreach my $h (split (/\s+/, $args)) { ! if (my $g=host_singleton_group($h) ) { disen_watch($g, 1); mysystem("$CF{MONREMOTE} enable watch $g") if ($CF{MONREMOTE}); - $stchanged++; - } else { - disen_host ($h, 1); - mysystem("$CF{MONREMOTE} enable host $h") if ($CF{MONREMOTE}); - $stchanged++; } } sock_write ($fh, "220 enable completed\n"); --- 2955,2966 ---- } elsif ($cmd eq "host") { foreach my $h (split (/\s+/, $args)) { ! foreach my $g (host_singleton_group($h)) { disen_watch($g, 1); mysystem("$CF{MONREMOTE} enable watch $g") if ($CF{MONREMOTE}); } + + disen_host ($h, 1); + mysystem("$CF{MONREMOTE} enable host $h") if ($CF{MONREMOTE}); + $stchanged++; } sock_write ($fh, "220 enable completed\n"); *************** *** 3795,3813 **** } sub host_singleton_group { my $host = shift; ! my $found; foreach my $g (keys %groups) { ! if (grep (/^$host$/, @{$groups{$g}}) && scalar(@{$groups{$g}}) == 1) { ! $found = $g; ! last; } } ! $found; } --- 3798,3823 ---- } + + + # + # given a host, search groups and return an array of group + # names which have that host as their only member. return + # an empty array if no group found + # + # sub host_singleton_group { my $host = shift; ! my @found; foreach my $g (keys %groups) { ! if (grep (/^\*?$host$/, @{$groups{$g}}) && scalar(@{$groups{$g}}) == 1) { ! push (@found, $g); } } ! return (@found); } |
From: Jim T. <tr...@us...> - 2007-06-03 20:07:23
|
Update of /cvsroot/mon/mon/mon.d In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23496/mon.d Modified Files: Tag: mon-1-2-branch smtp3.monitor Log Message: updates to smtp3.monitor from meekj Index: smtp3.monitor =================================================================== RCS file: /cvsroot/mon/mon/mon.d/smtp3.monitor,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** smtp3.monitor 15 Nov 2004 14:45:19 -0000 1.2 --- smtp3.monitor 3 Jun 2007 20:07:16 -0000 1.2.2.1 *************** *** 1,10 **** #!/usr/bin/perl ! # Yet another smtp monitor using IO::Socket with timing and logging # # $Id$ # ! # Copyright (C) 2001-2003, Jon Meek, me...@ie... # # This program is free software; you can redistribute it and/or modify --- 1,11 ---- #!/usr/bin/perl ! # Yet another smtp monitor using IO::Socket with timing, logging ! # This version looks deeper than the banner to catch milter and other problems # # $Id$ # ! # Copyright (C) 2001-2006, Jon Meek, meekj at ieee.org # # This program is free software; you can redistribute it and/or modify *************** *** 42,46 **** =head1 SYNOPSIS ! B<smtp3.monitor> [-d] [-l log_file_YYYYMM.log] [--timeout timeout_seconds] [--alarmtime alarm_time] [--mx] [--esmtp] [--requiretls] [--nofail] [--from us...@do...] [--to r1...@d1...,r2...@d2...] [--size nnnnn] [--port nn] host host1 host2 ... =head1 OPTIONS --- 43,47 ---- =head1 SYNOPSIS ! B<smtp3.monitor> [-d] [-l log_file_YYYYMM.log] [--timeout timeout_seconds] [--alarmtime alarm_time] [--maxfailtime seconds] [--mx] [--esmtp] [--requiretls] [--nofail] [--from us...@do...] [--to r1...@d1...,r2...@d2...] [--size nnnnn] [--port nn] host host1 host2 ... =head1 OPTIONS *************** *** 48,72 **** =over 5 ! =item B<-d> Debug/Diagnostic mode. Useful for manual command line use for diagnosing mail delivery problems. To determine if a mail destination will accept mail the --mx flag will useful. ! =item B<--timeout timeout> Connect timeout in seconds. ! =item B<--alarmtime alarm_timeout> Alarm if connect is successful but took ! longer than alarm_timeout seconds. =item B<-l log_file_template> /path/to/logs/smtp_YYYYMM.log Current year & month are substituted for YYYYMM, that is the only possible template at this time. ! =item B<--mx> Lookup the MX records for the domains/hosts and test ! them in preference order. The first successful test will be ! considered a success for that domain. This was originally devised for ! manual command line use as a tool to verify that mail stuck in ! outbound queues really can not be delivered. It could be used with mon ! as well, however you are usually going to want to test ALL of your ! smtp servers, not just be sure that one of them is OK. --mx applies to ! all of the domains/hosts listed on the command line. =item B<--esmtp> --- 49,89 ---- =over 5 ! =item B<-d> ! ! Debug/Diagnostic mode. Useful for manual command line use for diagnosing mail delivery problems. To determine if a mail destination will accept mail the --mx flag will useful. ! =item B<--timeout timeout> ! Connect timeout in seconds. ! ! =item B<--alarmtime alarm_timeout> ! ! Alarm if connect is successful but took longer than alarm_timeout ! seconds. ! ! =item B<--maxfailtime seconds> ! ! Alarm if connect fails only if the response time is greater than this ! value. If a Sendmail server is in REFUSE_LA, or similar, state due to ! load it will usually reject the connection in a few milliseconds. A ! typical value might be 0.050 for servers near the monitoring system. =item B<-l log_file_template> /path/to/logs/smtp_YYYYMM.log + Current year & month are substituted for YYYYMM, that is the only possible template at this time. ! =item B<--mx> ! ! Lookup the MX records for the domains/hosts and test them in ! preference order. The first successful test will be considered a ! success for that domain. This was originally devised for manual ! command line use as a tool to verify that mail stuck in outbound ! queues really can not be delivered. It could be used with mon as well, ! however you are usually going to want to test ALL of your smtp ! servers, not just be sure that one of them is OK. --mx applies to all ! of the domains/hosts listed on the command line. =item B<--esmtp> *************** *** 156,162 **** =head1 AUTHOR ! Jon Meek, me...@ie... =cut use English; use Sys::Hostname; --- 173,182 ---- =head1 AUTHOR ! Jon Meek, meekj at ieee.org ! ! $Id$ =cut + use English; use Sys::Hostname; *************** *** 177,180 **** --- 197,201 ---- 't=i' => \$TimeOut, 'alarmtime=i' => \$opt_T, + 'maxfailtime=f' => \$MaxFailTime, 'T=i' => \$opt_T, 'logfile=s' => \$opt_l, *************** *** 495,498 **** --- 516,525 ---- $ConnectTime{$host} = sprintf("-%0.4f", $dt); # Format to 100us resolution, -val if failure print " Connect to $host failed\n" if $opt_d; + if ($MaxFailTime) { + if ($dt <= $MaxFailTime) { # Don't alarm on connection refusals due to server load + $Failure = 0; + return 1; + } + } push(@Failures, $host); # Save failed host $FailureDetail{$host} = "Connect failed"; |
From: Jim T. <tr...@us...> - 2007-06-03 20:07:23
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23496 Modified Files: Tag: mon-1-2-branch CHANGES Log Message: updates to smtp3.monitor from meekj Index: CHANGES =================================================================== RCS file: /cvsroot/mon/mon/CHANGES,v retrieving revision 1.3.2.10 retrieving revision 1.3.2.11 diff -C2 -d -r1.3.2.10 -r1.3.2.11 *** CHANGES 3 Jun 2007 20:05:25 -0000 1.3.2.10 --- CHANGES 3 Jun 2007 20:07:16 -0000 1.3.2.11 *************** *** 46,49 **** --- 46,52 ---- by Jon Meek + -updates to smtp3.monitor, --alarmtime, --maxfailtime + by Jon Meek + Changes between mon-1.0.0pre3 and mon-1.0.0pre4 |
From: Jim T. <tr...@us...> - 2007-06-03 20:05:34
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22632 Modified Files: Tag: mon-1-2-branch CHANGES Log Message: updates to http_tppnp.monitor Index: CHANGES =================================================================== RCS file: /cvsroot/mon/mon/CHANGES,v retrieving revision 1.3.2.9 retrieving revision 1.3.2.10 diff -C2 -d -r1.3.2.9 -r1.3.2.10 *** CHANGES 3 Jun 2007 13:43:35 -0000 1.3.2.9 --- CHANGES 3 Jun 2007 20:05:25 -0000 1.3.2.10 *************** *** 43,46 **** --- 43,48 ---- by Jon Meek + -added --okstring, Cache-Control http header, --debuglog, to http_tppnp.monitor + by Jon Meek |
From: Jim T. <tr...@us...> - 2007-06-03 20:05:34
|
Update of /cvsroot/mon/mon/mon.d In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22632/mon.d Modified Files: Tag: mon-1-2-branch http_tppnp.monitor Log Message: updates to http_tppnp.monitor Index: http_tppnp.monitor =================================================================== RCS file: /cvsroot/mon/mon/mon.d/http_tppnp.monitor,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** http_tppnp.monitor 15 Nov 2004 14:45:19 -0000 1.2 --- http_tppnp.monitor 3 Jun 2007 20:05:25 -0000 1.2.2.1 *************** *** 13,21 **** # Jon Meek # Lawrenceville, NJ ! # me...@ie... # # $Id$ # ! # Copyright (C) 2002, Jon Meek # # This program is free software; you can redistribute it and/or modify --- 13,21 ---- # Jon Meek # Lawrenceville, NJ ! # meekj at ieee.org # # $Id$ # ! # Copyright (C) 2004, Jon Meek # # This program is free software; you can redistribute it and/or modify *************** *** 49,53 **** =head1 SYNOPSIS ! B<http_tppnp.monitor> -l log_file_YYYYMM.log [--servertimeout nn] [--clienttimeout nn] [--responsealarmtime nn] [--randskew nn] [--okcodes nnn,mmm,kkk] [--nocache] [--pipe pipename] [--stripprotocol] [--smartalarm smartalarm.module] [--sacfg smartalarm.cfg] [--smartalarmdir /smartalarm/path] [--forcesmartalarm] [--d --debug] [--v] host [host:/path_to_doc ...] The host list can be in any combination of the following: --- 49,53 ---- =head1 SYNOPSIS ! B<http_tppnp.monitor> -l log_file_YYYYMM.log [--servertimeout nn] [--clienttimeout nn] [--responsealarmtime nn] [--randskew nn] [--okcodes nnn,mmm,kkk] [--okstring 'Required string'] [--nocache] [--pipe pipename] [--stripprotocol] [--smartalarm smartalarm.module] [--sacfg smartalarm.cfg] [--smartalarmdir /smartalarm/path] [--forcesmartalarm] [--d --debug] [--debuglog file] [--v] host [host:/path_to_doc ...] The host list can be in any combination of the following: *************** *** 82,88 **** but must be explicitly included in the list if -c or --okcodes is used. =item B<--nocache> ! Add 'Pragma: no-cache' header to all requests. Used to bypass caches. =item B<--servertimeout N s> --- 82,99 ---- but must be explicitly included in the list if -c or --okcodes is used. + =item B<--okstring 'Required string'> + + If defined, the string must be present in the content for the test to + pass. The string can be a simple Perl regular expression, be sure to + test it on your data. Note that Perl regular expression special + characters ( +?.*^$()[{|\ ) may need to be escaped if your string is + NOT supposed to be a regular expression. + =item B<--nocache> ! Add 'Pragma: no-cache' and 'Cache-Control: max-stale=0' headers to all ! requests. In addition, check for Warning headers which indicate that ! the content was delivered from the cache anyway. This seems to be ! required when monitoring certain Web sites through certain cache servers. =item B<--servertimeout N s> *************** *** 181,188 **** allow multiple sets of server/clients to run simultaneously. ! =item B<-d> Debug/Test, for manual testing only. =item B<-v> --- 192,203 ---- allow multiple sets of server/clients to run simultaneously. ! =item B<-d> or B<--debug> Debug/Test, for manual testing only. + =item B<--debuglog file> + + Write debug and response data to file. Defaults to STDOUT. + =item B<-v> *************** *** 212,216 **** service internet_web interval 5m ! monitor http_tpps.monitor -l /usr/local/mon/logs/internet_web_YYYYMM.log -T 10 -t 15 period wd {Sun-Sat} alert mail.alert firewall_admin --- 227,231 ---- service internet_web interval 5m ! monitor http_tppnp.monitor -l /usr/local/mon/logs/internet_web_YYYYMM.log -T 10 -t 15 period wd {Sun-Sat} alert mail.alert firewall_admin *************** *** 219,225 **** Command line test examples: ! http_tpps.monitor -d www.redhat.com bns.pha.com mythey.com/_mem_bin/FormsLogin.asp\?/ nonexist.pha.com www.sun.com/@proxy.labs.theyw.com ! http_tpps.monitor -d www...@pr... www.sun.com/@proxy.labs.theyw.com www.yahoo.com/@proxy.labs.theyw.com =head1 BUGS --- 234,240 ---- Command line test examples: ! http_tppnp.monitor -d www.redhat.com bns.pha.com mythey.com/_mem_bin/FormsLogin.asp\?/ nonexist.pha.com www.sun.com/@proxy.labs.theyw.com ! http_tppnp.monitor -d www...@pr... www.sun.com/@proxy.labs.theyw.com www.yahoo.com/@proxy.labs.theyw.com =head1 BUGS *************** *** 242,248 **** processes appear, this method should be reviewed. ! The above problem could be avoided by a mon option to ignore alerts with an empty failure summary. =head1 REQUIRED PERL MODULES --- 257,267 ---- processes appear, this method should be reviewed. ! The above problem could be avoided with a mon option to ignore alerts with an empty failure summary. + There should be multiple "debug" output levels. One level should + report only information useful to a user running the program manually, + such as response times, byte counts, special headers, etc. + =head1 REQUIRED PERL MODULES *************** *** 257,271 **** =head1 AUTHOR ! Jon Meek, me...@ie... =head1 SEE ALSO ! http_tp.monitor ! http_tpp.monitor (should not be used, this monitor is a replacement) ! phttp.monitor by Gilles LAMIRAL ! lwp-http.mon by Daniel Hagerty (ha...@li...) =cut --- 276,292 ---- =head1 AUTHOR ! Jon Meek, meekj at ieee.org =head1 SEE ALSO ! http.monitor Use only for simple testing of a small number of hosts. ! http_tp.monitor Not actively maintained. ! http_tpp.monitor Should not be used, this monitor is a replacement. ! phttp.monitor by Gilles LAMIRAL ! ! lwp-http.mon by Daniel Hagerty (hag at linnaean.org) =cut *************** *** 282,285 **** --- 303,311 ---- $SmartAlarmConfig = ''; # Initialize, in case none is supplied + # + # Note that options needed in the client space must be passed on the client + # command line. See sub ForkClient below. + # + GetOptions( "servertimeout=i" => \$ServerTimeout, *************** *** 289,292 **** --- 315,319 ---- "randskew=i" => \$RandSkew, "okcodes=s" => \$opt_c, + "okstring=s" => \$OKstring, "pipe=s" => \$NamedPipe, "c=s" => \$opt_c, *************** *** 323,326 **** --- 350,357 ---- $TimeOfDay = time; + if ($Debug) { # STDOUT is default destination for debug messages + $DebugLog = q{-} unless defined $DebugLog; + } + if ($DebugLog) { open(DEBUGLOG, ">>$DebugLog") || warn "Can't open debug log: $DebugLog"; *************** *** 355,359 **** if ($Proxy ne 'noproxy') { ! $ua->proxy('http', "http://$Proxy"); # Need to generalize this } --- 386,390 ---- if ($Proxy ne 'noproxy') { ! $ua->proxy('http', "http://$Proxy"); # Need to generalize this for other protocols } *************** *** 363,368 **** ! if ($NoCache) { ! $response = $ua->get($URL, Pragma => 'no-cache'); # Request fresh content } else { $response = $ua->request(GET $URL); --- 394,399 ---- ! if ($NoCache) { # Request fresh content to get past caches ! $response = $ua->get($URL, Pragma => 'no-cache', 'Cache-Control' => 'max-stale=0'); } else { $response = $ua->request(GET $URL); *************** *** 373,381 **** --- 404,424 ---- $ResultCode = $response->code(); + $WarningHeader = $response->header('Warning'); # Some caches might return this, see check below $TheContent = $response->content(); $ByteCount = length($TheContent); + if ($NoCache && ($WarningHeader =~ /(\d{3})/)) { # Be sure that fresh data were delivered + $WarningCode = $1; # If not, alter the Result Code to force an alarm + $ResultCode = 503 if (($WarningCode >= 110) && ($WarningCode < 199)); + } + + $StringCheckFail = 0; + if ($OKstring) { # Check the content to verify that the required string is present + $StringCheckFail = 1 if ($TheContent !~ /$OKstring/); + } + print DEBUGLOG "URL: $URL $ResultCode $ByteCount $dt\n" if $Debug; + print "Warning Header: $WarningHeader\n" if $Debug; print $TheContent if $opt_v; # *************** *** 384,388 **** if (-p $NamedPipe) { # Be sure that the pipe is there, otherwise our server may have exited open (PIPE, ">$NamedPipe") || die "Can't open pipe: $NamedPipe\n"; ! print PIPE "$URL $Proxy $ResultCode $ByteCount $dt\n"; print DEBUGLOG "\nChild($$) --------- Exiting normally ---------\n" if $Debug; exit 0; # The client invocation ends here --- 427,431 ---- if (-p $NamedPipe) { # Be sure that the pipe is there, otherwise our server may have exited open (PIPE, ">$NamedPipe") || die "Can't open pipe: $NamedPipe\n"; ! print PIPE "$URL $Proxy $ResultCode $StringCheckFail $ByteCount $dt\n"; print DEBUGLOG "\nChild($$) --------- Exiting normally ---------\n" if $Debug; exit 0; # The client invocation ends here *************** *** 502,505 **** --- 545,550 ---- if ($host_path =~ /@/) { ($host_path, $proxy_server) = split(/@/, $host_path, 2); + } elsif (defined $Proxy) { # Allow one proxy to be set for all tests, but override with @ in host/path + $proxy_server = $Proxy; } *************** *** 549,553 **** $in = <PIPE>; print DEBUGLOG "Data from pipe: $in" if $Debug; ! ($s{url}, $s{proxy}, $s{result_code}, $s{byte_count}, $s{dt}) = split(' ', $in); $url = $s{url}; --- 594,598 ---- $in = <PIPE>; print DEBUGLOG "Data from pipe: $in" if $Debug; ! ($s{url}, $s{proxy}, $s{result_code}, $s{string_check_fail}, $s{byte_count}, $s{dt}) = split(' ', $in); $url = $s{url}; *************** *** 561,564 **** --- 606,610 ---- # $httpCode{$URL_Proxy} = $s{result_code}; + $httpStringFail{$URL_Proxy} = $s{string_check_fail}; $httpTime{$URL_Proxy} = $s{dt}; $httpSize{$URL_Proxy} = $s{byte_count}; *************** *** 579,583 **** # Process the results, exit occurs from ProcessResults # ! &ProcessResults(\%httpCode, \%httpTime, \%httpSize); ############# End of Server Code ############################################ --- 625,629 ---- # Process the results, exit occurs from ProcessResults # ! &ProcessResults(\%httpCode, \%httpStringFail, \%httpTime, \%httpSize); ############# End of Server Code ############################################ *************** *** 605,608 **** --- 651,655 ---- $execstring .= ' -d' if $Debug; $execstring .= " --debuglog $DebugLog" if $DebugLog; + $execstring .= " --okstring '$OKstring'" if $OKstring; $execstring .= ' -v' if $opt_v; print DEBUGLOG "execstring: $execstring\n" if $Debug; *************** *** 624,628 **** # sub ProcessResults { ! my ($Codes, $Times, $Sizes) = @_; my @Failures = (); --- 671,675 ---- # sub ProcessResults { ! my ($Codes, $StringFail, $Times, $Sizes) = @_; my @Failures = (); *************** *** 687,690 **** --- 734,742 ---- } + if ($StringFail->{$r}) { + $ThisOneFailed++; + $FailureDetail{$r} .= qq{String '$OKstring' is missing}; + } + if ($ThisOneFailed) { push(@Failures, $r); |
From: Jim T. <tr...@us...> - 2007-06-03 13:45:04
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22843 Modified Files: Tag: mon-1-2-branch CHANGES Log Message: added local-syslog.monitor Index: CHANGES =================================================================== RCS file: /cvsroot/mon/mon/CHANGES,v retrieving revision 1.3.2.8 retrieving revision 1.3.2.9 diff -C2 -d -r1.3.2.8 -r1.3.2.9 *** CHANGES 3 Jun 2007 13:14:27 -0000 1.3.2.8 --- CHANGES 3 Jun 2007 13:43:35 -0000 1.3.2.9 *************** *** 40,43 **** --- 40,45 ---- by Jon Meek + -added local-syslog.monitor + by Jon Meek |
From: Jim T. <tr...@us...> - 2007-06-03 13:43:38
|
Update of /cvsroot/mon/mon/mon.d In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22843/mon.d Added Files: Tag: mon-1-2-branch local-syslog.monitor Log Message: added local-syslog.monitor --- NEW FILE: local-syslog.monitor --- #!/usr/bin/perl # # A syslog monitor for mon, with support for Cisco router messages # # $Id: local-syslog.monitor,v 1.1.2.1 2007/06/03 13:43:35 trockij Exp $ # # Copyright (C) 2001-2006, Jon Meek, meekj at ieee.org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # =head1 NAME B<local-syslog.monitor> - syslog monitor for mon =head1 DESCRIPTION Watch local syslog log files and alert when a regular expression is matched. Include router interface descriptions for logs generate by a Cisco router. =head1 SYNOPSIS When the regular expression is matched, an alert is triggered. The alert details contain the actual log entries that matched. An optional additional description can be added to the details for an IP address / Interface Name pair if the log entry comes from a Cisco router. A common usage involves having other systems send their syslog information to this mon server so they can be watched by this monitor. =head1 OPTIONS =over 5 =item B<-c> Configuration file =item B<-d> Debug/Test. Useful for manual command line use. =back =head1 CONFIGURATION FILE =item B<Strings> Regular expression that will trigger an alarm when there is a match. =item B<BaseDir> The top of the directory tree where the syslog files are kept. =item B<File> Syslog files are usually specified on the command line, but can be listed in the config file as well. =item B<Extended Name> IP Address / Interface Name pairs can be expanded in the details section of an alert. These lines consist of an IP address followed by whitespace, then the interface name followed by whitespace, then a description of the interface. This is added to the alert if the log entry is found to match the output generated from a Cisco router. Example: Strings %BGP-5|%LINEPROTO-5-UPDOWN|%LINK-3-UPDOWN BaseDir /d2/logs/remotesyslog #File exnetmon-gv/cisco.log #File ot-gv/cisco.log 192.168.56.1 FastEthernet0/0 To Extranet Switch 192.168.56.1 Serial0/0 Frame-Relay DHEC266467 DLCI 612 192.168.56.1 FastEthernet0/1 Inside Interface 192.168.56.1 Serial0/1 T-1 to ICO DHEC397828 =head1 MON CONFIGURATION EXAMPLE hostgroup remote-syslog exnetmon-wl/cisco.log ot-wl/cisco.log watch remote-syslog service syslog interval 15m monitor local-syslog.monitor -c /usr/local/mon/syslog.cfg period wd {Sun-Sat} alert mail.alert meekj-at-ieee.org =head1 AUTHOR Jon Meek, meekj at ieee.org =cut use Getopt::Std; #use File::Basename; #use Time::HiRes qw( gettimeofday tv_interval ); $BaseDir = ''; @Failures = (); # Initialize failure list $TimeOfDay = time; # Current time getopts ("dc:"); if (defined $ENV{MON_STATEDIR}) { # Are we running under mon? $STATE_DIR = $ENV{MON_STATEDIR}; $RunningUnderMon = 1; } else { $RunningUnderMon = 0; } if ($opt_c) { # Read configuration file $ConfigFile = $opt_c; if (open(C, $ConfigFile)) { while ($in = <C>) { last if ($in =~ /^Exit/i); next if ($in =~ /^\#/); # Comments chomp $in; if ($in =~ /^BaseDir/i) { ($tag, $BaseDir) = split(' ', $in, 2); next; } if ($in =~ /^File/i) { ($tag, $file) = split(' ', $in, 2); push(@Files, $file); next; } if ($in =~ /^Strings/i) { ($tag, $data) = split(' ', $in, 2); $RegEx .= $data; next; } if ($in =~ /^[0-9\.]+/) { ($router_ip, $interface_name, $description) = split(' ', $in, 3); # print "$router_ip - $interface_name - $description\n" if $opt_d; $RouterInterfaceDescription{"$router_ip $interface_name"} = $description; next; } if ($in =~ /^RouterList/i) { ($tag, $RouterListFile) = split(' ', $in, 2); next; } if ($in =~ /^StateDir/i) { # If the mon environment variable needs to be overriden ($tag, $STATE_DIR) = split(' ', $in, 2); next; } } } else { print "local-syslog.monitor: Couldn't open $ConfigFile configuration file\n"; exit 1; } } push (@Files, @ARGV); # Get file names from the command line foreach $File (@Files) { $FullPath = "$BaseDir/$File"; if (!-e $FullPath) { # File does not exist print "**** $FullPath does not exist\n" if $opt_d; next; } $StateFile = $FullPath; $StateFile =~ s/\//-/g; # Change / to - to make filename $StateFile =~ s/^-//; $StateFile = "$STATE_DIR/$StateFile"; # # Read the previous file sizes if the State File exists # if (-e $StateFile) { print "Existing $StateFile\n" if $opt_d; open(F, $StateFile); $in = <F>; ($t, $last_size) = split(' ', $in); close F; $StateFileExists = 1; # Remember that there is a existing State File } else { $StateFileExists = 0; # or not $last_size = 0; print "No Existing $StateFile\n" if $opt_d; } # # Get file information # ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat($FullPath); # $basename = basename($SmartAlarm); # Get the path to the module # $dirname = dirname($SmartAlarm); print "$StateFile Last size: $last_size Size - : $size\n" if $opt_d; next if ($size == $last_size); # File has not changed since last check (may want to check time too) $FailureDetail{$File} = ''; open(F, $FullPath); if ($size > $last_size) { # Position to read new lines only seek(F, $last_size, 0); } while ($in = <F>) { chomp $in; if ($in =~ /$RegEx/o) { # Check the master regular expression # # see if we have a description on the router/interface (from cisco) # if ($in =~ /^(\w{3}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2})\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) { $router_ip = $2; $in =~ /\s+Interface\s+([\w\/\.]+)/; $interface_name = $1; # print "*** $router_ip $interface_name\n"; if (exists $RouterInterfaceDescription{"$router_ip $interface_name"}) { $in .= ' [' . $RouterInterfaceDescription{"$router_ip $interface_name"} . ']'; } } $HaveFailureData{$File}++; $FailureDetail{$File} .= "$in\n"; print "$in\n" if $opt_d; } } $CurrentPosition = tell(F); print "Final Position: $CurrentPosition\n" if $opt_d; close F; # Write new state file print "Writing a new $StateFile\n" if $opt_d; open(F, ">$StateFile"); print F "$TimeOfDay $CurrentPosition\n"; close F; } foreach $k (sort keys %HaveFailureData) { push(@Failures, $k); } if (@Failures == 0) { # Indicate "all OK" to mon exit 0; } # # Otherwise we have one or more failures # print "@Failures\n"; foreach $k (@Failures) { print "$k $FailureDetail{$k}\n"; } print "\n"; exit 1; # Indicate failure to mon |
From: Jim T. <tr...@us...> - 2007-06-03 13:14:31
|
Update of /cvsroot/mon/mon/mon.d In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2538/mon.d Modified Files: Tag: mon-1-2-branch ntpdate.monitor Log Message: update to ntpdate.monitor Index: ntpdate.monitor =================================================================== RCS file: /cvsroot/mon/mon/mon.d/ntpdate.monitor,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** ntpdate.monitor 6 Oct 2004 16:31:51 -0000 1.3 --- ntpdate.monitor 3 Jun 2007 13:14:27 -0000 1.3.2.1 *************** *** 43,47 **** time server stratum offset delay ! time is in UNIX seconds, offset, and delay are in seconds. =item B<-shortalerts> --- 43,49 ---- time server stratum offset delay ! time is in UNIX seconds, offset, and delay are in seconds. Note that ! offset and delay times in mon detail, and the optional HTML page are ! in milliseconds. =item B<-shortalerts> *************** *** 81,85 **** Listing a server twice can cause ntpdate to report that server as ! Stratum 0. The shortalerts option only reports the hostname, it could be extended --- 83,87 ---- Listing a server twice can cause ntpdate to report that server as ! Stratum 0. This can happen even if an alias name is used. The shortalerts option only reports the hostname, it could be extended *************** *** 94,102 **** =head1 AUTHOR ! Jon Meek, me...@ie... =head1 SEE ALSO ! ntp.monitor by Daniel Hagerty <ha...@li...> =cut --- 96,104 ---- =head1 AUTHOR ! Jon Meek, meekj at ieee.org =head1 SEE ALSO ! ntp.monitor by Daniel Hagerty <hag at linnaean.org> =cut *************** *** 112,116 **** # $Id$ # ! # Copyright (C) 2002, Jon Meek # # This program is free software; you can redistribute it and/or modify --- 114,118 ---- # $Id$ # ! # Copyright (C) 2002-2006, Jon Meek # # This program is free software; you can redistribute it and/or modify *************** *** 164,168 **** $NTPDATE = '/usr/sbin/ntpdate' unless $NTPDATE; ! $HtmlFileHandle = &HTMLheader($HtmlFile) if ($HtmlFile ne "" && HTMLheader); @Failures = (); --- 166,170 ---- $NTPDATE = '/usr/sbin/ntpdate' unless $NTPDATE; ! $HtmlFileHandle = &HTMLheader($HtmlFile) if $HtmlFile; @Failures = (); *************** *** 174,190 **** print "TimeOfDay: $TimeOfDay\n" if $Debug; ! $cmd = qq{$NTPDATE -q @Hosts 2>&1 |}; ! ! $pid = open(NTP, $cmd) || die "Couldn't run $cmd\n"; ! $detail = ""; ! $ntpdate_output = ""; while ($in = <NTP>) { # print $in if $Debug; - $ntpdate_output .= $in; - chomp $in; - # # Pick out server strings --- 176,186 ---- print "TimeOfDay: $TimeOfDay\n" if $Debug; ! $cmd = qq{$NTPDATE -q @Hosts |}; ! $pid = open(NTP, $cmd) || die "Couldn't run $cmd: $!\n"; while ($in = <NTP>) { # print $in if $Debug; chomp $in; # # Pick out server strings *************** *** 198,203 **** print "$in Name: $name Stratum: $stratum\n" if $Debug; - $detail .= "$in Name: $name Stratum: $stratum\n"; - if (exists $NameByIP{$ip}) { # Use system name if we have it $HostName = $NameByIP{$ip}; --- 194,197 ---- *************** *** 225,234 **** } # # Build formatted results and check alarm limits # ! $FmtDetail = qq{NTP Server Delta, s Stratum Rel, s Offset, s\n}; ! &HTMLtableHeader($HtmlFileHandle, 'NTP Server', 'Delta, s', 'Stratum', 'Rel, s', 'Offset, s', 'Status') if ($HtmlFile ne ""); foreach $hostname (sort keys %Stratum) { --- 219,232 ---- } + #1234567890123456789012345678901234567890123456789012345678901234567890 + #fwmon-gv.gv.us.pri.wyeth.com 0.276 2 0.413 61.050 + + # # Build formatted results and check alarm limits # ! $FmtDetail = qq{NTP Server times in milliseconds Delta Stratum Rel Delay\n}; ! &HTMLtableHeader($HtmlFileHandle, 'NTP Server', 'Delta, ms', 'Stratum', 'Rel, ms', 'Delay, ms', 'Status') if $HtmlFile; foreach $hostname (sort keys %Stratum) { *************** *** 236,244 **** $DeltaTimeByHost{$hostname} = $DeltaTime; ! $FmtDetail .= sprintf ("%-40s %12.6f %3d %12.6f %12.6f", ! $hostname, $DeltaTime, $Stratum{$hostname}, $Offset{$hostname}, $Delay{$hostname}); ! $fail_string = ' '; if (($Stratum{$hostname} > $MaxStratum) || ($Stratum{$hostname} < $MinStratum) || (abs($DeltaTime) > $MaxOffset)) { --- 234,245 ---- $DeltaTimeByHost{$hostname} = $DeltaTime; ! $msDeltaTime = 1000 * $DeltaTime; ! $msOffset = 1000 * $Offset{$hostname}; ! $msDelay = 1000 * $Delay{$hostname}; ! $FmtDetail .= sprintf ("%-35s %9.3f %3d %9.3f %9.3f", ! $hostname, $msDeltaTime, $Stratum{$hostname}, $msOffset, $msDelay); + $fail_string = ' '; if (($Stratum{$hostname} > $MaxStratum) || ($Stratum{$hostname} < $MinStratum) || (abs($DeltaTime) > $MaxOffset)) { *************** *** 249,259 **** $fail_string = 'Fail'; } - $FmtDetail .= "\n"; ! if ($HtmlFile ne "") { ! $fDeltaTime = sprintf("%12.6f", $DeltaTime); ! $fOffset = sprintf("%12.6f", $Offset{$hostname}); ! $fDelay = sprintf("%12.6f", $Delay{$hostname}); &HTMLtableRow($HtmlFileHandle, $hostname, $fDeltaTime, $Stratum{$hostname}, $fOffset, $fDelay, $fail_string); } --- 250,259 ---- $fail_string = 'Fail'; } $FmtDetail .= "\n"; ! if ($HtmlFile) { ! $fDeltaTime = sprintf("%12.3f", $msDeltaTime); ! $fOffset = sprintf("%12.3f", $msOffset); ! $fDelay = sprintf("%12.3f", $msDelay); &HTMLtableRow($HtmlFileHandle, $hostname, $fDeltaTime, $Stratum{$hostname}, $fOffset, $fDelay, $fail_string); } *************** *** 261,269 **** } - print "\n$FmtDetail\n" if $Debug; - $detail .= "\n$FmtDetail\n"; - # # Write results to logfile, if -l --- 261,266 ---- *************** *** 293,299 **** } ! foreach $ip (sort keys %LogString) { ! print "LOG: $LogString{$ip}\n" if ($Debug); ! $detail .= "LOG: $LogString{$ip}\n"; } --- 290,297 ---- } ! if ($Debug) { ! foreach $ip (sort keys %LogString) { ! print "LOG: $LogString{$ip}\n"; ! } } *************** *** 301,306 **** if (@Failures == 0) { # Indicate "all OK" to mon - print "\n$detail"; - print "\nntpdate -q output:\n\n$ntpdate_output"; exit 0; } --- 299,302 ---- *************** *** 329,333 **** print "------- Details -------\n" if $Debug; ! print $detail; #foreach $hostname (sort keys %FailureDetail) { --- 325,329 ---- print "------- Details -------\n" if $Debug; ! print $FmtDetail; #foreach $hostname (sort keys %FailureDetail) { *************** *** 335,345 **** #} - print "\nntpdate -q output:\n\n$ntpdate_output"; - exit 1; # Indicate failure to mon - ############################################################################## - - # # Get the IP addresses for the hosts (because ntpdate returns IP addresses) --- 331,336 ---- |
From: Jim T. <tr...@us...> - 2007-06-03 13:14:31
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2538 Modified Files: Tag: mon-1-2-branch CHANGES Log Message: update to ntpdate.monitor Index: CHANGES =================================================================== RCS file: /cvsroot/mon/mon/CHANGES,v retrieving revision 1.3.2.7 retrieving revision 1.3.2.8 diff -C2 -d -r1.3.2.7 -r1.3.2.8 *** CHANGES 3 Jun 2007 13:08:58 -0000 1.3.2.7 --- CHANGES 3 Jun 2007 13:14:27 -0000 1.3.2.8 *************** *** 37,40 **** --- 37,44 ---- by Jon Meek + -updated output formatting in ntpdate.monitor + by Jon Meek + + |
From: Jim T. <tr...@us...> - 2007-06-03 13:09:05
|
Update of /cvsroot/mon/mon/mon.d In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32211/mon.d Modified Files: Tag: mon-1-2-branch traceroute.monitor Log Message: traceroute.monitor update Index: traceroute.monitor =================================================================== RCS file: /cvsroot/mon/mon/mon.d/traceroute.monitor,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** traceroute.monitor 15 Nov 2004 14:45:19 -0000 1.2 --- traceroute.monitor 3 Jun 2007 13:08:59 -0000 1.2.2.1 *************** *** 14,22 **** # Jon Meek # Lawrenceville, NJ ! # me...@ie... # # $Id$ # ! # Copyright (C) 2001, Jon Meek # # This program is free software; you can redistribute it and/or modify --- 14,22 ---- # Jon Meek # Lawrenceville, NJ ! # meekj at ieee.org # # $Id$ # ! # Copyright (C) 2001-2005, Jon Meek # # This program is free software; you can redistribute it and/or modify *************** *** 46,50 **** =head1 SYNOPSIS ! B<traceroute.monitor -d -t 20 -c /path/to/traceroute.cf -l /usr/local/mon/logs/routes_YYYYMM.log> The logfile template is usually specified in the configuration file. --- 46,50 ---- =head1 SYNOPSIS ! B<traceroute.monitor -d -t 20 -c -u /path/to/traceroute.cf -l /usr/local/mon/logs/routes_YYYYMM.log> The logfile template is usually specified in the configuration file. *************** *** 54,67 **** =over 5 ! =item B<-d> Debug/Test ! =item B<-c config.cfg> Configuration file for this monitor, see example below ! =item B<-t timeout> Timeout for traceroute to run in seconds default is 20s =item B<-l log_file_template> /path/to/logs/internet_web_YYYYMM.log Current year & month are substituted for YYYYMM, that is the only possible template at this time. =back --- 54,87 ---- =over 5 ! =item B<-d> ! Debug/Test ! =item B<-c config.cfg> ! ! Configuration file for this monitor, see example below ! ! =item B<-t timeout> ! ! Timeout for traceroute to run in seconds default is 20s =item B<-l log_file_template> /path/to/logs/internet_web_YYYYMM.log + Current year & month are substituted for YYYYMM, that is the only possible template at this time. + =item B<-u> + + Fail On Unexpected Hop Only - An alert will be triggered if any of the + IP addresses specified using the UnexpectedHop item in the + configuration file are observed. Any other route change will not + create an alert. This option is useful for alerting when a backup + circuit becomes part of a default route. This option causes + traceroute.monitor to act more like a traditional mon monitor because + an alert will be triggered on every monitor run if an UnexpectedHop + appears in the path. The use of mon's alertafter N directive can be + used to filter out short term glitches that might cause a route to + change for just one monitor cycle. + =back *************** *** 81,85 **** =head1 CONFIGURATION FILE EXAMPLE ! # tracreoute.monitor Config File RouteLogFile /usr/local/mon/logs/routes_YYYYMM.log RouterList /usr/local/mon/rt.list --- 101,105 ---- =head1 CONFIGURATION FILE EXAMPLE ! # traceroute.monitor Config File RouteLogFile /usr/local/mon/logs/routes_YYYYMM.log RouterList /usr/local/mon/rt.list *************** *** 91,94 **** --- 111,120 ---- StopAt 172.30.124.17 A firewall StopAt 172.31.124.17 Another firewall + UnexpectedHop 10.22.249.2 S2S VPN Tunnel + AlertMessage + For more details see: + http://$HOSTNAME/cgi-bin/network/traceroute.anal + EndAlertMessage + Lines with '#' in the first column are ignored. *************** *** 100,107 **** RouterList - Optional IP address to router name translation in ! /etc/hosts format (IP_address router_bame). Supplying this list will provide considerably more meaningful alarm messages, especially if the ! router names contain geographical information. Without this list the ! extended alarm is just a list of interface IP addresses. Traceroute - Overrides the default of /usr/sbin/traceroute --- 126,134 ---- RouterList - Optional IP address to router name translation in ! /etc/hosts format (IP_address router_name). Supplying this list will provide considerably more meaningful alarm messages, especially if the ! router names contain geographical information. Without this list, or ! DNS records, the extended alarm is just a list of interface IP ! addresses. DNS results take precedence over this list. Traceroute - Overrides the default of /usr/sbin/traceroute *************** *** 127,130 **** --- 154,169 ---- directive. There can be multiple StopAt lines. + UnexpectedHop - See the description of the -u option above. The + presence of an UnexpectedHop in a path will trigger an alarm + regardless of whether the -u option is set, or not. + + AlertMessage - A message that is appended to the alert details starts + on the next line. $HOSTNAME, if present in the message, is converted + to the name of the machine on which the monitor is running. + + EndAlertMessage - The AlertMessage can be terminated by this + directive, but it is not required if the message is at the end of the + configuration file. + =head1 BUGS *************** *** 141,149 **** =cut ! use Getopt::Std; ! use POSIX qw(:signal_h WNOHANG); ! use POSIX qw(strftime); ! getopts ("vdt:l:c:"); # -l file Log file name with optional YYYYMM part that will be transformed to current month --- 180,199 ---- =cut ! use Getopt::Long; ! use Sys::Hostname; ! use POSIX qw(:signal_h WNOHANG strftime); ! use Socket; ! #getopts ("vdt:l:c:"); ! ! GetOptions ('v' => \$opt_v, ! 'd' => \$opt_d, ! 'debug' => \$opt_d, ! 't=i' => \$opt_t, ! 'l=s' => \$opt_l, ! 'c=s' => \$opt_c, ! 'u' => \$FailOnUnexpectedHopOnly, ! 'unexpectedhoponly' => \$FailOnUnexpectedHopOnly, ! ); # -l file Log file name with optional YYYYMM part that will be transformed to current month *************** *** 152,156 **** # Usual Linux config ! $TRACEROUTE = '/usr/sbin/traceroute'; #$STATE_DIR = '/usr/local/mon/state.d'; --- 202,206 ---- # Usual Linux config ! $TRACEROUTE = '/bin/traceroute'; #$STATE_DIR = '/usr/local/mon/state.d'; *************** *** 214,217 **** --- 264,282 ---- } + if ($in =~ /^UnexpectedHop\s+/i) { + ($tag, $ip, $name) = split(' ', $in, 3); + print "UnexpectedHop $ip, $name<br>\n" if $opt_d; + $UnexpectedHop{$ip}++; + $UnexpectedHopName{$ip} = $name; + } + + if ($in =~ /^AlertMessage/i) { # Extra text to add to an alert starts on next line + while ($in = <C>) { + last if ($in =~ /^EndAlertMessage/i); + $AlertMessage .= $in; + } + $MonitorHostname = hostname; + $AlertMessage =~ s/\$HOSTNAME/$MonitorHostname/; + } } } else { *************** *** 242,246 **** if ($TestOnly) { foreach $h (@Hosts) { ! print "Host: $h\n"; if (defined $EquivIP{$h}) { --- 307,312 ---- if ($TestOnly) { foreach $h (@Hosts) { ! $name = &HopName($h); ! print "Host: $h $name\n"; if (defined $EquivIP{$h}) { *************** *** 319,326 **** $ThisHopIP = $1; push(@HopList, $ThisHopIP); # Build route hop list if ($opt_v) { chomp $in; ! print "$in $RouterByIP{$ThisHopIP}\n"; } --- 385,396 ---- $ThisHopIP = $1; push(@HopList, $ThisHopIP); # Build route hop list + if ($UnexpectedHop{$ThisHopIP}) { + $UnexpectedHopSeen{$TargetHost}++; + } if ($opt_v) { chomp $in; ! $name = &HopName($h); ! print "$in $name $RouterByIP{$ThisHopIP}\n"; } *************** *** 396,400 **** } ! if (&RouteChanged($current_route, $prev_route)) { # Route changed, alarm and record if ($RunningUnderMon) { # Write results open(S, ">$state_file") || warn "Can't open $state_file for writing\n"; --- 466,475 ---- } ! $ThisTargetFailed = 0; ! $ThisTargetFailed++ if $UnexpectedHopSeen{$k}; ! ! if (&RouteChanged($current_route, $prev_route)) { # Route changed, record, alarm if not using only unexpected hops ! $ThisTargetFailed++ unless $FailOnUnexpectedHopOnly; ! $LogString{$k} = $ResultString{$k}; # Use separate string for logging route changes so that we don't always log unexpected hops if ($RunningUnderMon) { # Write results open(S, ">$state_file") || warn "Can't open $state_file for writing\n"; *************** *** 402,405 **** --- 477,483 ---- close S; } + } + + if ($ThisTargetFailed) { push (@Failures, $k); print " Alarm\n" if $opt_d; *************** *** 413,416 **** --- 491,495 ---- close S; } + # $LogString{$k} = $ResultString{$k}; # Always log the first instance push (@Failures, $k); # Call it a failure so it will be logged and notification will be sent print " New route added to check: $k\n" if $opt_d; *************** *** 419,425 **** } ! # Write results to logfile, if -l ! ! #if ($RunningUnderMon && $LogFile) { if ($LogFile) { --- 498,504 ---- } ! # ! # Write results to logfile ! # if ($LogFile) { *************** *** 445,452 **** } ! if (($NewLogFile == 0) && (@Failures > 0)) { # Just record changes ! foreach $host (sort @Failures) { ! print LOG "$ResultString{$host}\n"; } } --- 524,532 ---- } ! if (($NewLogFile == 0) && (@Failures > 0)) { # Just record changes, not repeated unexpected hops ! foreach $host (sort keys %LogString) { ! print LOG "$LogString{$host}\n"; } + } *************** *** 459,463 **** } ! if (defined $RouterListFile) { # Read the router names if we have a failure open(F, $RouterListFile); --- 539,544 ---- } ! # Note that we might have already read this file if --v was specified ! # if (defined $RouterListFile) { # Read the router names if we have a failure open(F, $RouterListFile); *************** *** 479,487 **** (@hop_ips) = split(/\-/, $rest); foreach $hop_ip (@hop_ips) { ! printf " %-15s %s\n", $hop_ip, $RouterByIP{$hop_ip}; } print "\n"; } exit 1; --- 560,575 ---- (@hop_ips) = split(/\-/, $rest); foreach $hop_ip (@hop_ips) { ! $name = &HopName($hop_ip); ! printf " %-15s %s", $hop_ip, $name; ! print " Unexpected Hop: $UnexpectedHopName{$hop_ip}" if ($UnexpectedHop{$hop_ip}); ! print "\n"; } print "\n"; } + if (defined $AlertMessage) { + print "\n$AlertMessage\n"; + } + exit 1; *************** *** 515,516 **** --- 603,634 ---- } + sub HopName { + my ($h_ip) = @_; + my ($lookupname, $ha); + # print "HopName: $h_ip<br>\n" if $opt_d; + if ($h_ip =~ /^\*/) { + $name = 'Not reached'; + return $name; + } + + if (exists $HopNameCache{$h_ip}) { # Already have the name + $name = $HopNameCache{$h_ip}; + return $name; + } + $name = ''; + $ha = inet_aton($h_ip); + $lookupname = gethostbyaddr($ha, &AF_INET); + + if (length($lookupname) > 0) { # Attempt lookup of address via "normal" system methods (DNS, hosts, etc) + $name = $lookupname; + } elsif ($UseRouterList) { + $name = $RouterByIP{$h_ip} if (exists $RouterByIP{$h_ip}); + } + + # Have an auxilliary name? such as "London Internet Router", prepend it + # $name = qq{$RouteHopName{$h_ip} $name} if (exists $RouteHopName{$h_ip}); + + $HopNameCache{$h_ip} = $name; + # print "$h_ip -- $name<br>\n" if $opt_d; + return $name; + } |
From: Jim T. <tr...@us...> - 2007-06-03 13:09:05
|
Update of /cvsroot/mon/mon/doc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32211/doc Modified Files: Tag: mon-1-2-branch mon.8 Log Message: traceroute.monitor update Index: mon.8 =================================================================== RCS file: /cvsroot/mon/mon/doc/mon.8,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** mon.8 3 May 2007 19:41:25 -0000 1.6.2.1 --- mon.8 3 Jun 2007 13:08:59 -0000 1.6.2.2 *************** *** 598,602 **** set by the .B \-s ! command-line parameter. Multiple alert paths may be specified by separating them with --- 598,604 ---- set by the .B \-s ! command-line parameter. If this path does not begin with a "/", it will be ! relative to ! .IR basedir . Multiple alert paths may be specified by separating them with *************** *** 615,619 **** is the full path to the state directory. .B mon ! uses this directory to save various state information. .TP --- 617,623 ---- is the full path to the state directory. .B mon ! uses this directory to save various state information. If this path does not begin with a "/", it will be ! relative to ! .IR basedir . .TP *************** *** 623,632 **** .B mon uses this directory to save various logs, including ! the downtime log. .TP .BI "basedir = " dir .I dir ! is the full path for the state, script, and alert directory. .TP --- 627,638 ---- .B mon uses this directory to save various logs, including ! the downtime log. If this path does not begin with a "/", it will be ! relative to ! .IR basedir . .TP .BI "basedir = " dir .I dir ! is the full path for the state, log, monitor, and alert directories. .TP *************** *** 639,643 **** .BI "authfile = " file .I file ! is the full path to the authentication file. .TP --- 645,651 ---- .BI "authfile = " file .I file ! is the path to the authentication file. If the path does not begin ! with a "/", it will be relative to ! .IR cfbasedir . .TP |
From: Jim T. <tr...@us...> - 2007-06-03 13:09:04
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32211 Modified Files: Tag: mon-1-2-branch CHANGES README Log Message: traceroute.monitor update Index: README =================================================================== RCS file: /cvsroot/mon/mon/README,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** README 17 Apr 2005 07:42:25 -0000 1.3 --- README 3 Jun 2007 13:08:58 -0000 1.3.2.1 *************** *** 5,32 **** ------------ ! "mon" is a tool for monitoring the availability of services. Services ! may be network-related, environmental conditions, or nearly anything ! that can be tested with software. It is extremely useful for system ! administrators, but not limited to use by them. It was designed to be a ! general-purpose problem alerting system, separating the tasks of testing ! services for availability and sending alerts when things fail. To achieve ! this, "mon" is implemented as a scheduler which runs the programs which ! do the testing, and triggering alert programs when these scripts detect ! failure. None of the actual service testing or reporting is actually ! handled by "mon". These functions are handled by auxillary programs. This model was chosen because it is very extensible, and does not require changing the code of the scheduler to add new tests or alert types. For ! example, an alphanumeric paging alert can be added simply by writing a ! new alert script, and referencing the alert script in the configuration ! file. Monitoring the temperature in a room can be done by adding a script ! that gathers data from a thermistor via a serial port. Often these ! monitoring scripts can just be wrappers for pre-existing software, such ! as "ping" or "ftp". ! The "mon" scheduler also can serve network clients, allowing manipulation ! of run-time parameters, disabling and enabling of alerts and tests, ! listing failure and alert history, and reporting of current states of ! all monitors. There are several clients which come with the distribution, found in --- 5,38 ---- ------------ ! "mon" is a tool for monitoring the availability of services, and sending alerts ! on prescribed events. Services are defined as anything tested by a "monitor" ! program, which can be something as simple as pinging a system, or as complex as ! analyzing the results of an application-level transaction. Alerts are ! actions such as sending emails, making submissions to ticketing systems, ! or triggering resource fail-over in a high-availability cluster. ! ! The tool is extremely useful for system administrators, but not limited to use ! by them. It was designed to be a general-purpose problem alerting system, ! separating the tasks of testing services for availability and sending alerts ! when things fail. To achieve this, "mon" is implemented as a scheduler which ! runs the programs which do the testing, and triggering alert programs when ! these scripts detect failure. Alerts can be controlled by a variety of ! "squelch" knobs, and complex dependencies can be configured to help suppress ! excessive alerts. + None of the actual service testing or reporting is actually handled directly by + the mon server itself. These functions are handled by auxillary programs. This model was chosen because it is very extensible, and does not require changing the code of the scheduler to add new tests or alert types. For ! example, an alphanumeric paging alert can be added simply by writing a new ! alert script, and referencing the alert script in the configuration file. ! Monitoring the temperature in a room can be done by adding a script that ! gathers data from a thermistor via a serial port. Often these monitoring ! scripts can just be wrappers for pre-existing software, such as "ping" or ! "ftp". ! The mon scheduler also can service network clients, allowing manipulation ! of run-time parameters, disabling and enabling of alerts and tests, listing ! failure and alert history, and reporting of current states of all monitors. There are several clients which come with the distribution, found in Index: CHANGES =================================================================== RCS file: /cvsroot/mon/mon/CHANGES,v retrieving revision 1.3.2.6 retrieving revision 1.3.2.7 diff -C2 -d -r1.3.2.6 -r1.3.2.7 *** CHANGES 11 May 2007 01:00:24 -0000 1.3.2.6 --- CHANGES 3 Jun 2007 13:08:58 -0000 1.3.2.7 *************** *** 34,37 **** --- 34,41 ---- by Tim Berger + -added -u option, "UnexpectedHop", "AlertMessage", to traceroute.monitor + by Jon Meek + + Changes between mon-1.0.0pre3 and mon-1.0.0pre4 |
From: Jim T. <tr...@us...> - 2007-05-11 01:00:32
|
Update of /cvsroot/mon/mon/mon.d In directory sc8-pr-cvs16:/tmp/cvs-serv586/mon.d Modified Files: Tag: mon-1-2-branch fping.monitor Log Message: fix to fping.monitor to make it work with fping 2.2b1 Index: fping.monitor =================================================================== RCS file: /cvsroot/mon/mon/mon.d/fping.monitor,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** fping.monitor 17 Apr 2005 07:42:27 -0000 1.3 --- fping.monitor 11 May 2007 01:00:26 -0000 1.3.2.1 *************** *** 69,73 **** { chomp; ! if (/^(\S+).*unreachable/i) { push (@unreachable, $1); --- 69,73 ---- { chomp; ! if (/^(\S+) is unreachable/) { push (@unreachable, $1); |
From: Jim T. <tr...@us...> - 2007-05-11 01:00:31
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs16:/tmp/cvs-serv586 Modified Files: Tag: mon-1-2-branch CHANGES INSTALL Log Message: fix to fping.monitor to make it work with fping 2.2b1 Index: CHANGES =================================================================== RCS file: /cvsroot/mon/mon/CHANGES,v retrieving revision 1.3.2.5 retrieving revision 1.3.2.6 diff -C2 -d -r1.3.2.5 -r1.3.2.6 *** CHANGES 8 May 2007 11:25:42 -0000 1.3.2.5 --- CHANGES 11 May 2007 01:00:24 -0000 1.3.2.6 *************** *** 2,6 **** Changes between mon-1.2.0- and mon-1.2.0-release ! Tue May 8 06:59:41 EDT 2007 ----------------------------------------------- --- 2,6 ---- Changes between mon-1.2.0- and mon-1.2.0-release ! Thu May 10 20:59:34 EDT 2007 ----------------------------------------------- *************** *** 28,31 **** --- 28,37 ---- by Arkadiusz Miskiewicz + -fix to fping.monitor to correct parsing of fping 2.2b1 output. It prints + lines like "ICMP Host Unreachable from" to stderr, but to stdout it + prints "(host) is unreachable", and the regex was matching both, which + is wrong. + by Tim Berger + Changes between mon-1.0.0pre3 and mon-1.0.0pre4 Index: INSTALL =================================================================== RCS file: /cvsroot/mon/mon/INSTALL,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** INSTALL 15 Nov 2004 14:45:16 -0000 1.2 --- INSTALL 11 May 2007 01:00:25 -0000 1.2.2.1 *************** *** 35,39 **** Time::Period PRYAN/Period-1.20.tar.gz Time::HiRes J/JH/JHI/Time-HiRes-1.59.tar.gz - Convert::BER G/GB/GBARR/Convert-BER-1.3101.tar.gz --- 35,38 ---- |
From: Jim T. <tr...@us...> - 2007-05-08 11:25:46
|
Update of /cvsroot/mon/mon/mon.d In directory sc8-pr-cvs16:/tmp/cvs-serv25704/mon.d Modified Files: Tag: mon-1-2-branch ftp.monitor Log Message: added fix to ftp.monitor to handle multiline reply after quit command by Arkadiusz Miskiewicz Index: ftp.monitor =================================================================== RCS file: /cvsroot/mon/mon/mon.d/ftp.monitor,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.4.1 *** ftp.monitor 9 Jun 2004 05:18:05 -0000 1.1.1.1 --- ftp.monitor 8 May 2007 11:25:42 -0000 1.1.1.1.4.1 *************** *** 172,183 **** $result->{"detail"} .= " > quit\n"; ! $in = <S>; ! $result->{"detail"} .= " < $in"; ! if ($in !~ /^221 /) { ! alarm 0; ! $result->{"ok"} = 0; ! $result->{"error"} = "FTP server error after quit"; ! close(S); ! return undef; } --- 172,185 ---- $result->{"detail"} .= " > quit\n"; ! while ($in = <S>) { ! $result->{"detail"} .= " < $in"; ! next if ($in =~ /^[0-9]{3}\-/); ! if ($in !~ /^221 /) { ! alarm 0; ! $result->{"ok"} = 0; ! $result->{"error"} = "FTP server error after quit"; ! close(S); ! return undef; ! } } |
From: Jim T. <tr...@us...> - 2007-05-08 11:25:46
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs16:/tmp/cvs-serv25704 Modified Files: Tag: mon-1-2-branch CHANGES Log Message: added fix to ftp.monitor to handle multiline reply after quit command by Arkadiusz Miskiewicz Index: CHANGES =================================================================== RCS file: /cvsroot/mon/mon/CHANGES,v retrieving revision 1.3.2.4 retrieving revision 1.3.2.5 diff -C2 -d -r1.3.2.4 -r1.3.2.5 *** CHANGES 8 May 2007 11:22:29 -0000 1.3.2.4 --- CHANGES 8 May 2007 11:25:42 -0000 1.3.2.5 *************** *** 25,28 **** --- 25,31 ---- by Arkadiusz Miskiewicz + -added fix to ftp.monitor to handle multiline reply after quit command + by Arkadiusz Miskiewicz + Changes between mon-1.0.0pre3 and mon-1.0.0pre4 |
From: Jim T. <tr...@us...> - 2007-05-08 11:22:35
|
Update of /cvsroot/mon/mon/mon.d In directory sc8-pr-cvs16:/tmp/cvs-serv24403/mon.d Modified Files: Tag: mon-1-2-branch msql-mysql.monitor Log Message: added hard timeout patch to msql-mysql.monitor by Arkadiusz Miskiewicz Index: msql-mysql.monitor =================================================================== RCS file: /cvsroot/mon/mon/mon.d/msql-mysql.monitor,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.4.1 *** msql-mysql.monitor 9 Jun 2004 05:18:04 -0000 1.1.1.1 --- msql-mysql.monitor 8 May 2007 11:22:29 -0000 1.1.1.1.4.1 *************** *** 54,62 **** use DBI; use Getopt::Long; my @details=(); my @failures=(); ! GetOptions( \%options, "mode=s", "port=i", "username=s", "password=s", "database=s" ); # uncomment these two lines and provide suitable information if you don't --- 54,70 ---- use DBI; use Getopt::Long; + use POSIX ':signal_h'; my @details=(); my @failures=(); ! my $mask = POSIX::SigSet->new( SIGALRM ); ! my $action = POSIX::SigAction->new( ! sub { die "connect timeout" }, # the handler code ref ! $mask, ! # not using (perl 5.8.2 and later) 'safe' switch or sa_flags ! ); ! ! GetOptions( \%options, "mode=s", "port=i", "username=s", "password=s", "database=s", "timeout=i" ); # uncomment these two lines and provide suitable information if you don't *************** *** 65,68 **** --- 73,78 ---- #$options{password} ||= "password"; + $options{timeout} = 60 if ! $options{timeout}; + if( $0 =~ m/\/msql\.monitor$/ || $options{mode} =~ m/msql/i ) { $mode = "mSQL"; *************** *** 77,82 **** for $host( @ARGV ) { ! my( $dbh ) = DBI->connect( "DBI:$mode:$options{database}:$host:$options{port}", $options{username}, $options{password}, { PrintError => 0 } ); ! if( ! $dbh ) { push( @failures, $host); push( @details, "$host: Could not connect to $mode server on $options{port}: " . $DBI::errstr . "\n"); --- 87,105 ---- for $host( @ARGV ) { ! my $dbh = 0; ! my $oldaction = POSIX::SigAction->new(); ! sigaction( 'ALRM', $action, $oldaction ); ! eval { ! alarm $options{timeout}; ! $dbh = DBI->connect( "DBI:$mode:$options{database}:$host:$options{port}", $options{username}, $options{password}, { PrintError => 0 } ); ! alarm 0; ! }; ! alarm 0; ! sigaction( 'ALRM', $oldaction ); ! if ($@) { ! push( @failures, $host); ! push( @details, "$host: Could not connect to $mode server on $options{port}: $@\n"); ! next; ! } elsif( ! $dbh ) { push( @failures, $host); push( @details, "$host: Could not connect to $mode server on $options{port}: " . $DBI::errstr . "\n"); |
From: Jim T. <tr...@us...> - 2007-05-08 11:22:33
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs16:/tmp/cvs-serv24403 Modified Files: Tag: mon-1-2-branch CHANGES Log Message: added hard timeout patch to msql-mysql.monitor by Arkadiusz Miskiewicz Index: CHANGES =================================================================== RCS file: /cvsroot/mon/mon/CHANGES,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -C2 -d -r1.3.2.3 -r1.3.2.4 *** CHANGES 8 May 2007 11:05:47 -0000 1.3.2.3 --- CHANGES 8 May 2007 11:22:29 -0000 1.3.2.4 *************** *** 22,25 **** --- 22,28 ---- by Jim Trocki + -added hard timeout patch to msql-mysql.monitor + by Arkadiusz Miskiewicz + Changes between mon-1.0.0pre3 and mon-1.0.0pre4 |
From: Jim T. <tr...@us...> - 2007-05-08 11:05:56
|
Update of /cvsroot/mon/mon/mon.d In directory sc8-pr-cvs16:/tmp/cvs-serv16113/mon.d Modified Files: Tag: mon-1-2-branch http.monitor snmpdiskspace.monitor Log Message: added -m to http.monitor fixed path to perl in snmpdiskspace.monitor Index: http.monitor =================================================================== RCS file: /cvsroot/mon/mon/mon.d/http.monitor,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.4.1 *** http.monitor 9 Jun 2004 05:18:05 -0000 1.1.1.1 --- http.monitor 8 May 2007 11:05:48 -0000 1.1.1.1.4.1 *************** *** 11,14 **** --- 11,15 ---- # -a agent User-Agent, default to "mon.d/http.monitor" # -o omit http headers from healthy hosts + # -m regex match regex in response (header + content) # # Jon Meek *************** *** 40,48 **** sub httpGET; ! getopts ("p:t:u:a:o"); $PORT = $opt_p || 80; $TIMEOUT = $opt_t || 30; $URL = $opt_u || "/"; $USERAGENT = $opt_a || "mon.d/http.monitor"; my %good; --- 41,50 ---- sub httpGET; ! getopts ("p:t:u:a:m:o"); $PORT = $opt_p || 80; $TIMEOUT = $opt_t || 30; $URL = $opt_u || "/"; $USERAGENT = $opt_a || "mon.d/http.monitor"; + $MATCHRE = $opt_m; my %good; *************** *** 102,106 **** my $Path = $URL; ! my $result; ############################################################### --- 104,112 ---- my $Path = $URL; ! my $result = { ! "ok" => 0, ! "error" => undef, ! "header" => undef, ! }; ############################################################### *************** *** 129,164 **** } - # HTTP/1.1 200 OK - - if ($TheContent =~ /^HTTP\/([\d\.]+)\s+(200|30[12]|401)\b/) { - $ServerOK = 1; - } else { - $ServerOK = 0; - } - close(S); alarm 0; # Cancel the alarm - }; ! my ($header) = ($TheContent =~ /^(.*?)\r?\n\r?\n/s); ! if ($EVAL_ERROR and ($EVAL_ERROR =~ /^Timeout Alarm/)) { ! return { ! "ok" => 0, ! "error" => "timeout after $TIMEOUT seconds", ! "header" => $header, ! }; } ! if ($result->{"error"} ne "") { ! return $result; } ! return { ! "ok" => $ServerOK, ! "header" => $header, ! "error" => undef, ! }; } --- 135,166 ---- } close(S); alarm 0; # Cancel the alarm }; ! ($result->{"header"}) = ($TheContent =~ /^(.*?)\r?\n\r?\n/s); ! if ($TheContent =~ /^HTTP\/([\d\.]+)\s+(200|30[12]|401)\b/) { ! $result->{"ok"} = 1; ! } else { ! $result->{"ok"} = 0; ! $result->{"error"} = "HTTP response code failure"; } ! if ($MATCHRE ne "") { ! if ($TheContent =~ /$MATCHRE/s) { ! $result->{"ok"} = 1; ! } else { ! $result->{"ok"} = 0; ! $result->{"error"} = $error = "Regex match failed"; ! } } ! if ($EVAL_ERROR and ($EVAL_ERROR =~ /^Timeout Alarm/)) { ! $result->{"ok"} = 0; ! $result->{"error"} = "timeout after $TIMEOUT seconds"; ! } ! ! return $result; } Index: snmpdiskspace.monitor =================================================================== RCS file: /cvsroot/mon/mon/mon.d/snmpdiskspace.monitor,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** snmpdiskspace.monitor 2 May 2007 23:25:07 -0000 1.1.2.1 --- snmpdiskspace.monitor 8 May 2007 11:05:49 -0000 1.1.2.2 *************** *** 1,3 **** ! #!/usr/local/bin/perl # # NAME --- 1,3 ---- ! #!/usr/bin/perl # # NAME |