mon-devel Mailing List for mon (Page 3)
Brought to you by:
trockij
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(13) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
(27) |
Mar
|
Apr
(9) |
May
(11) |
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(15) |
2006 |
Jan
|
Feb
(6) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
(14) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(4) |
Dec
(8) |
2008 |
Jan
(6) |
Feb
(4) |
Mar
(7) |
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2009 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2010 |
Jan
(11) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(7) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(3) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Augie S. <aug...@gm...> - 2008-03-17 23:31:29
|
I revamped just about the whole monitor; added POD and support for: comparing binary log file names from master and slave. comparing actual update time by updating a table on the master and comparing the results on the slaves. ability to set different master/slave ports,passwords, and user names. differentiating between the real number of seconds a slave is behind and how many seconds a slave thinks it is behind. debugging flag. --Augie On Mon, Mar 17, 2008 at 4:14 PM, Augie Schwer <as...@us...> wrote: > Update of /cvsroot/mon/mon/mon.d > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31583 > > Modified Files: > mysql-replication.monitor > Log Message: > Added some substantial features: master/slave comparisons for binary logs and updates, debugging flag, real POD. > > Index: mysql-replication.monitor > =================================================================== > RCS file: /cvsroot/mon/mon/mon.d/mysql-replication.monitor,v > retrieving revision 1.1 > retrieving revision 1.2 > diff -C2 -d -r1.1 -r1.2 > *** mysql-replication.monitor 1 Dec 2007 00:28:11 -0000 1.1 > --- mysql-replication.monitor 17 Mar 2008 23:14:12 -0000 1.2 > *************** > *** 1,6 **** > #!/usr/bin/perl > - # arguments: > - # [ --username=username --password=password --port=# ] hostname(s) > > use DBI; > use Getopt::Long; > --- 1,125 ---- > #!/usr/bin/perl > > + =head1 NAME > + > + mysql-replication.monitor - Monitor MySQL Replication for the "mon" system. > + > + =head1 SYNOPSIS > + > + mysql-replicaiton.monitor > + > + =over > + > + --slave-user=username --slave-pass=password --slave-port=# > + > + [ --master-host=hostname --master-user=username --master-pass=password --master-port=# ] > + > + [ --binlogs=# --slave-seconds=# --real-seconds=# --debug ] hostname(s) ... > + > + =back > + > + =head1 DESCRIPTION > + > + mysql-replication.monitor will connect to the slave host(s) and potentially the master to compare values to provided thresholds. > + > + =over > + > + =item slave-user > + > + User name to use when connecting to the slave host(s). > + > + =item slave-pass > + > + Password to use when connecting to the slave host(s). > + > + =item slave-port > + > + Port number to use when connecting to the slave host(s). > + > + =item master-host > + > + Host name of the master host. > + > + =item master-user > + > + User name to use when connecting to the master host. > + > + =item master-pass > + > + Password to use when connecting to the master host. > + > + =item master-port > + > + Port number to use when connecting to the master host. > + > + =item binlogs > + > + Number of binary logs behind a master a slave is allowed to be before alarming. > + > + This requires that you provide the 'master-*' variables. > + > + =item slave-seconds > + > + The number of seconds behind a master a slave thinks it is before alarming. This is the Seconds_Behind_Master you see when > + you do a 'SHOW SLAVE STATUS\G' on a slave; which is actually how far behind the SQL thread is compared to the binary logs > + it has locally; this does not help if your slave does not have the most up to date binary log from the master. See the link > + below for more information: > + > + http://dev.mysql.com/doc/refman/5.0/en/replication-faq.html#qandaitem-16-3-4-3 > + > + =item real-seconds > + > + This is the number of seconds behind a master a slave actually is before alarming. This is a far more pedantic approach to > + monitoring lag in your slaves then the 'slave-seconds' option, but may also be overkill for some sites. With this option set > + the monitor will actually update a table on the master with a time stamp and compare that same time stamp on the slave(s); > + if the two time stamps differ by more then the ammount specified here, then an alarm will be generated. > + > + To use this you will need to create a database named 'replication', allow your 'master-user' to connect to it and update a > + table called 'heartbeat'. The SQL commands below should help get you started: > + > + CREATE DATABASE replication; > + > + CREATE TABLE heartbeat (unix_time INTEGER NOT NULL); > + > + GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl-check'@'monitoring-host-name' IDENTIFIED BY 'pa$$word'; > + > + GRANT SELECT,UPDATE ON replication.heartbeat to 'repl-check'@'monitoring-host-name'; > + > + INSERT INTO HEARTBEAT (unix_time) VALUES (1205778309); > + > + This requires that you provide the 'master-*' variables. > + > + =item debug > + > + Will print out some helpful messages of what the monitor is doing while it's doing it. > + > + =back > + > + There is a section of the code that you can uncomment and set your variables there so that you do not have to pass > + everything on the command line. > + > + If you only provide the slave information, then only the status of the SQL and IO threads, and 'slave-seconds' can > + be checked. > + > + Providing master information will allow you to check the above and 'binlogs' and 'real-seconds'. > + > + A sample GRANT statement follows to help get you started: > + > + GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl-check'@'monitoring-host-name' IDENTIFIED BY 'pa$$word'; > + > + =head1 AUTHOR > + > + Augie Schwer, C<< <augie at schwer.us> >> > + > + http://www.schwer.us > + > + =head1 ACKNOWLEDGEMENTS > + > + I would like to thank Sonic.net for allowing me to release this to the public. > + > + =cut > + > + > + use strict; > use DBI; > use Getopt::Long; > *************** > *** 8,36 **** > my @details=(); > my @failures=(); > > ! GetOptions( \%options, "port=i", "username=s", "password=s" , "seconds=i" ); > > ! # uncomment these two lines and provide suitable information if you don't > ! # want to pass sensitive information on the command line > ! $options{username} ||= "repl-check"; > ! $options{password} ||= "m449kwf"; > ! $options{port} ||= 3306; > ! $options{seconds} ||= 3600; > > ! for $host( @ARGV ) { > ! my( $dbh ) = DBI->connect( "DBI:mysql:host=$host:port=$options{port}", $options{username}, $options{password}, { PrintError => 0 } ); > if( ! $dbh ) { > push( @failures, $host); > ! push( @details, "$host: Could not connect to MySQL server on $options{port}: " . $DBI::errstr . "\n"); > next; > } > > ! # Gather vital replication information. > my $sth = $dbh->prepare('SHOW SLAVE STATUS'); > $sth->execute; > my $slave = $sth->fetchrow_hashref; > - $sth->finish; > > ! # Check those variables. > if ( $slave->{Slave_IO_Running} ne 'Yes' ) > { > --- 127,231 ---- > my @details=(); > my @failures=(); > + my %options=(); > > ! GetOptions( \%options, > ! "slave-port=i", "slave-user=s", "slave-pass=s" , > ! "master-host=s" , "master-user=s" , "master-pass=s" , "master-port=i" , > ! "binlogs=i" , "slave-seconds=i" , "real-seconds=i" , "debug" > ! ); > > ! ######################################################################### > ! # Set options here if you don't want to pass options on the command line. > ! #$options{'slave-user'} ||= "repl-check"; > ! #$options{'slave-pass'} ||= 'pa$$word'; > ! #$options{'slave-port'} ||= 3306; > ! #$options{'master-host'} ||= 'localhost'; > ! #$options{'master-user'} ||= "repl-check"; > ! #$options{'master-pass'} ||= 'pa$$word'; > ! #$options{'master-port'} ||= 3306; > ! #$options{'binlogs'} ||= 3; > ! #$options{'slave-seconds'} ||= 3600; > ! #$options{'real-seconds'} ||= 3600; > ! ######################################################################### > > ! my $master; > ! > ! if ( (defined $options{'binlogs'}) or (defined $options{'real-seconds'}) ) > ! { > ! print "debug - Connecting to master with DSN : DBI:mysql:host=$options{'master-host'}:port=$options{'master-port'},$options{'master-user'},$options{'master-pass'} \n" if $options{'debug'}; > ! > ! my $dbh = DBI->connect( "DBI:mysql:host=$options{'master-host'}:port=$options{'master-port'}",$options{'master-user'},$options{'master-pass'}, { PrintError => 0 } ); > ! if( ! $dbh ) { > ! print "$options{'master-host'}\n"; > ! print "$options{'master-host'}: Could not connect to MySQL server on $options{'master-port'}: " . $DBI::errstr . "\n"; > ! exit 1; > ! } > ! > ! # Gather master replication information. > ! > ! print "debug - Gathering master replication information.\n" if $options{'debug'}; > ! > ! my $sth = $dbh->prepare('SHOW MASTER STATUS'); > ! $sth->execute; > ! $master = $sth->fetchrow_hashref; > ! > ! if (defined $options{'real-seconds'}) > ! { > ! $sth = $dbh->prepare('USE replication'); > ! $sth->execute; > ! > ! my $unix_time = time(); > ! $sth = $dbh->prepare('UPDATE heartbeat SET unix_time = ?'); > ! $sth->execute($unix_time); > ! > ! $master->{'unix_time'} = $unix_time; > ! > ! print "debug - Setting master 'unix_time' to $unix_time \n" if $options{'debug'}; > ! } > ! > ! $sth->finish(); > ! $dbh->disconnect(); > ! } > ! > ! for my $host( @ARGV ) { > ! print "debug - Connecting to slave host $host with DSN : DBI:mysql:host=$host:port=$options{'slave-port'},$options{'slave-user'},$options{'slave-pass'}\n" if $options{'debug'}; > ! > ! my $dbh = DBI->connect( "DBI:mysql:host=$host:port=$options{'slave-port'}", $options{'slave-user'},$options{'slave-pass'}, { PrintError => 0 } ); > if( ! $dbh ) { > push( @failures, $host); > ! push( @details, "$host: Could not connect to MySQL server on $options{'slave-port'}: " . $DBI::errstr . "\n"); > next; > } > > ! # Gather slave replication information. > ! > ! print "debug - Gathering slave replication information.\n" if $options{'debug'}; > ! > my $sth = $dbh->prepare('SHOW SLAVE STATUS'); > $sth->execute; > my $slave = $sth->fetchrow_hashref; > > ! if (defined $options{'real-seconds'}) > ! { > ! $sth = $dbh->prepare('USE replication'); > ! $sth->execute; > ! > ! $sth = $dbh->prepare('SELECT unix_time FROM heartbeat'); > ! $sth->execute; > ! > ! my ($unix_time) = $sth->fetchrow_array; > ! > ! $slave->{'unix_time'} = $unix_time; > ! > ! print "debug - Setting slave 'unix_time' to $unix_time \n" if $options{'debug'}; > ! } > ! > ! $sth->finish(); > ! $dbh->disconnect(); > ! > ! # Check slave variables. > ! > ! print "debug - Slave_IO_Running is $slave->{Slave_IO_Running}\n" if $options{'debug'}; > ! > if ( $slave->{Slave_IO_Running} ne 'Yes' ) > { > *************** > *** 40,43 **** > --- 235,240 ---- > } > > + print "debug - Slave_SQL_Running is $slave->{Slave_SQL_Running}\n" if $options{'debug'}; > + > if ( $slave->{Slave_SQL_Running} ne 'Yes' ) > { > *************** > *** 47,58 **** > } > > ! if ( $slave->{Seconds_Behind_Master} > $options{seconds} ) > { > push( @failures, $host); > ! push( @details, "$host: Slave is more than " . $options{seconds} . " seconds behind master.\n"); > next; > } > > ! $dbh->disconnect(); > } > > --- 244,287 ---- > } > > ! print "debug - Seconds_Behind_Master is $slave->{Seconds_Behind_Master}\n" if $options{'debug'}; > ! > ! if ( (defined $options{'slave-seconds'}) && ($slave->{Seconds_Behind_Master} > $options{'slave-seconds'}) ) > { > push( @failures, $host); > ! push( @details, "$host: Slave is more than " . $options{'slave-seconds'} . " slave seconds behind master.\n"); > next; > } > > ! # Check master variables > ! if ( defined $options{'binlogs'} ) > ! { > ! print "debug - master file is $master->{'File'}\n" if $options{'debug'}; > ! print "debug - slave file is $slave->{'Master_Log_File'}\n" if $options{'debug'}; > ! > ! $master->{'File_No'} = $1 if ($master->{'File'} =~ /(\d+)$/); > ! $slave->{'File_No'} = $1 if ($slave->{'Master_Log_File'} =~ /(\d+)$/); > ! > ! my $binlog_diff = $master->{'File_No'} - $slave->{'File_No'}; > ! if ( $binlog_diff > $options{'binlogs'} ) > ! { > ! push( @failures, $host); > ! push( @details, "$host: Slave is more than " . $options{'binlogs'} . " binary logs behind master.\n"); > ! next; > ! } > ! } > ! > ! if ( defined $options{'real-seconds'} ) > ! { > ! print "debug - master 'unix_time' is $master->{'unix_time'}\n" if $options{'debug'}; > ! print "debug - slave 'unix_time' is $slave->{'unix_time'}\n" if $options{'debug'}; > ! > ! my $realsec_diff = $master->{'unix_time'} - $slave->{'unix_time'}; > ! if ( $realsec_diff > $options{'real-seconds'} ) > ! { > ! push( @failures, $host); > ! push( @details, "$host: Slave is more than " . $options{'real-seconds'} . " real seconds behind master.\n"); > ! next; > ! } > ! } > } > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Mon-commit mailing list > Mon...@li... > https://lists.sourceforge.net/lists/listinfo/mon-commit > -- Augie Schwer - Augie@Schwer.us - http://schwer.us Key fingerprint = 9815 AE19 AFD1 1FE7 5DEE 2AC3 CB99 2784 27B0 C072 |
From: Augie S. <aug...@gm...> - 2008-03-12 17:02:24
|
On Wed, Mar 12, 2008 at 7:44 AM, Michael Osburn <mic...@ec...> wrote: > We are preparing to roll mon into our production environment. There is still a few things > that I need to prove to get the higher-ups approval. How are most of you managing planned system > downtime? Looking into the scripts it appears that mon has been designed more to load the mon.cf > file at startup and stays with it. Is the preferred way to remove and/or add a host to add it to > the config file and restart mon? Or am I missing a feature to have mon check it's configuration > file and reload if it changes? Disable the host or service that you plan on having down. http://mon.wiki.kernel.org/index.php/Documentation -- Augie Schwer - Augie@Schwer.us - http://schwer.us Key fingerprint = 9815 AE19 AFD1 1FE7 5DEE 2AC3 CB99 2784 27B0 C072 |
From: Wolfram S. <li...@wo...> - 2008-03-12 14:03:47
|
* Jim Trocki <tr...@ar...> [2007-12-03 18:56]: > On Fri, 30 Nov 2007, Wolfram Schlich wrote: >> I really don't want to bother you, but: any news on this upalertafter bug? >> :o) > > it'll be fixed this week. Jim, sorry for asking once again, but... when will upalertafter be fixed? TIA. -- Regards, Wolfram Schlich <wsc...@ge...> Gentoo Linux * http://dev.gentoo.org/~wschlich/ |
From: Augie S. <aug...@gm...> - 2008-03-11 16:35:58
|
On Mon, Mar 10, 2008 at 4:27 PM, Ed Ravin <er...@pa...> wrote: > 2) Augie, reading over your new script, it looks like we could do > the same thing by using snmpvar.monitor on > NETWORK-APPLIANCE-MIB::diskFailedCount with an entry like this in > snmpvar.def: Yeah, I thought about that, but shied away because I wanted to get the diskFailedMessage too; even though that may end up being totally useless. > It would be nice if we could roll all this stuff up and make up a NetApp > "howto" page for Mon. I would volunteer, except as mentioned above the > NetApps I have access to are rather ancient, and we're phasing them out... Well maybe you could write up the structure and I could fill it out; we have a handful of F760s and a couple FAS3020s. -- Augie Schwer - Augie@Schwer.us - http://schwer.us Key fingerprint = 9815 AE19 AFD1 1FE7 5DEE 2AC3 CB99 2784 27B0 C072 |
From: Ed R. <er...@pa...> - 2008-03-11 00:27:05
|
On Mon, Mar 10, 2008 at 03:15:53PM -0800, Augie Schwer wrote: > I created a new monitor to check for failed disks in NetApps; it's > based on the netappfree.monitor. > > I meant to just check it into the devel branch, but I ended up putting > it in both stable and devel.; hopefully not a big deal. Since it's a new program, it won't destabilize any existing code, which to me is the prime definition for something "stable". While we're on the subject of netapps, let's talk about who's polling what. My shop's mon.m4 runs several tests against our NetApps: ping rpc.monitor netappfree.monitor netappraidstat.monitor snmpvar.monitor - tests these vars: Variable NETAPP_FAILED_FAN_COUNT OID .1.3.6.1.4.1.789.1.2.4.2.0 Description Number of Netapp Failed Fans is Variable NETAPP_FAILED_POWER_SUPPLY_COUNT OID .1.3.6.1.4.1.789.1.2.4.4.0 Description Number of Netapp Failed Power Supplies is Variable NETAPP_TEMPERATURE_WARNING OID .1.3.6.1.4.1.789.1.2.4.1.0 Description Netapp Temperature Warning Decode 1 no Decode 2 yes Variable NETAPP_RAID_SPARES OID .1.3.6.1.4.1.789.1.6.4.8.0 Description Number of Available Spare Disks is 1) Did we ever check in all of Todd's fixes to netappraidstat.monitor? I have a version he emailed me on 21 Dec 2005 after we got it working on with the elderly NetApps at my site. 2) Augie, reading over your new script, it looks like we could do the same thing by using snmpvar.monitor on NETWORK-APPLIANCE-MIB::diskFailedCount with an entry like this in snmpvar.def: Variable NETAPP_DISKS_FAILED OID .1.3.6.1.4.1.789.1.6.4.7.0 Description Number of Failed Disks is It would be nice if we could roll all this stuff up and make up a NetApp "howto" page for Mon. I would volunteer, except as mentioned above the NetApps I have access to are rather ancient, and we're phasing them out... |
From: Augie S. <aug...@gm...> - 2008-03-10 23:15:55
|
I created a new monitor to check for failed disks in NetApps; it's based on the netappfree.monitor. I meant to just check it into the devel branch, but I ended up putting it in both stable and devel.; hopefully not a big deal. --Augie On Mon, Mar 10, 2008 at 3:12 PM, Augie Schwer <as...@us...> wrote: > Update of /cvsroot/mon/mon/mon.d > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21048 > > Added Files: > netappdiskfail.monitor > Log Message: > Created a new monitor to check for failed NetApp disks. > > --- NEW FILE: netappdiskfail.monitor --- > #!/usr/bin/perl > # > # Use SNMP to get disk failures from a NetApp. > # > # USAGE > # [--community=<SNMP COMMUNITY>] [--timeout=<seconds>] [--retries=<count>] host1 host2 ... > > # sample invocation in mon.cf, with local MIB directory for the Netapp MIB > # NETWORK-APPLIANCE-MIB.txt (copy from /etc/mib/netapp.mib on filer): > # service diskfree > # description test disk failure on Netapp filers > # depend SELF:ping > # MIBDIRS=/usr/local/share/snmp/mibs > # interval 7m > # monitor netappdiskfail.monitor > > # > # This requires the UCD SNMP library and G.S. Marzot's Perl SNMP > # module. > # > > use strict; > > use SNMP; > use Getopt::Long; > > $ENV{"MIBS"} = 'RFC1213-MIB:NETWORK-APPLIANCE-MIB'; > > my %opt = (); > > GetOptions (\%opt, "community=s", "timeout=i", "retries=i"); > > die "no host arguments\n" if (@ARGV == 0); > > my $RET = 0; > my @ERRS = (); > my %HOSTS = (); > > my $COMM = $opt{"community"} || "public"; > my $TIMEOUT = $opt{"timeout"} || 2; $TIMEOUT *= 1000 * 1000; > my $RETRIES = $opt{"retries"} || 5; > > my $sess; > > foreach my $host (@ARGV) { > if (!defined($sess = new SNMP::Session (DestHost => $host, > Timeout => $TIMEOUT, Community => $COMM, > Retries => $RETRIES, > Version => 1))) { > $RET = 1; > $HOSTS{$host} ++; > push (@ERRS, "could not create session to $host: " . $SNMP::Session::ErrorStr); > next; > } > > if ($sess->get('diskFailedCount.0') > 0) { > $HOSTS{$host} ++; > push (@ERRS, "Disk failure - " . $sess->get('diskFailedCount.0') . " failed disk(s)."); > push (@ERRS, $sess->get('diskFailedMessage.0')); > $RET = 1; > } > } > > if ($RET) { > print join(" ", sort keys %HOSTS), "\n\n", join("\n", @ERRS), "\n"; > } > > exit $RET; > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Mon-commit mailing list > Mon...@li... > https://lists.sourceforge.net/lists/listinfo/mon-commit > -- Augie Schwer - Augie@Schwer.us - http://schwer.us Key fingerprint = 9815 AE19 AFD1 1FE7 5DEE 2AC3 CB99 2784 27B0 C072 |
From: Augie S. <aug...@gm...> - 2008-02-08 00:33:59
|
Pretty trivial; I just needed a DNS monitor for both UDP and TCP; the changes below add a '-T' flag for TCP queries. --Augie On Feb 7, 2008 2:31 PM, Augie Schwer <as...@us...> wrote: > Update of /cvsroot/mon/mon/mon.d > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1090/mon.d > > Modified Files: > dns-query.monitor > Log Message: > Add support for TCP queries. > > Index: dns-query.monitor > =================================================================== > RCS file: /cvsroot/mon/mon/mon.d/dns-query.monitor,v > retrieving revision 1.1.1.1 > retrieving revision 1.2 > diff -C2 -d -r1.1.1.1 -r1.2 > *** dns-query.monitor 9 Jun 2004 05:18:06 -0000 1.1.1.1 > --- dns-query.monitor 7 Feb 2008 22:31:31 -0000 1.2 > *************** > *** 6,9 **** > --- 6,10 ---- > # -t timeout timeout (defaults to 5 seconds) > # -n name name to query, defaults to "mailhost" > + # -T Use TCP instead of default UDP. > # > # $Id$ > *************** > *** 31,38 **** > > my %opt; > ! getopts ("t:n:", \%opt); > > my $TIMEOUT = defined $opt{"t"} ? $opt{"t"} : 5; > my $NAME = $opt{"n"} || "mailhost"; > > my $r = Net::DNS::Resolver->new; > --- 32,40 ---- > > my %opt; > ! getopts ("t:n:T", \%opt); > > my $TIMEOUT = defined $opt{"t"} ? $opt{"t"} : 5; > my $NAME = $opt{"n"} || "mailhost"; > + my $USETCP = $opt{'T'}; > > my $r = Net::DNS::Resolver->new; > *************** > *** 43,47 **** > } > > ! $r->udp_timeout ($TIMEOUT); > > my (%good, %bad); > --- 45,57 ---- > } > > ! if ($USETCP) > ! { > ! $r->tcp_timeout ($TIMEOUT); > ! $r->usevc (1); > ! } > ! else > ! { > ! $r->udp_timeout ($TIMEOUT); > ! } > > my (%good, %bad); > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Mon-commit mailing list > Mon...@li... > https://lists.sourceforge.net/lists/listinfo/mon-commit > -- Augie Schwer - Augie@Schwer.us - http://schwer.us Key fingerprint = 9815 AE19 AFD1 1FE7 5DEE 2AC3 CB99 2784 27B0 C072 |
From: Wolfram S. <li...@wo...> - 2008-02-06 18:00:41
|
* Ed Ravin <er...@pa...> [2008-02-06 18:57]: > On Wed, Feb 06, 2008 at 06:52:46PM +0100, Wolfram Schlich wrote: > > * Wolfram Schlich <li...@wo...> [2008-01-29 22:51]: > > > * Jim Trocki <tr...@ar...> [2007-12-03 18:56]: > > > >> > > > >> I really don't want to bother you, but: any news on this upalertafter bug? > > > >> :o) > > > >> > > > > > > > > it'll be fixed this week. > > > > > > Ping :) > > > > Ping :) > > ICMP response from mon...@li...: developer unreachable I was really just awaiting something like this :))) -- Regards, Wolfram Schlich <wsc...@ge...> Gentoo Linux * http://dev.gentoo.org/~wschlich/ |
From: Ed R. <er...@pa...> - 2008-02-06 17:57:27
|
On Wed, Feb 06, 2008 at 06:52:46PM +0100, Wolfram Schlich wrote: > * Wolfram Schlich <li...@wo...> [2008-01-29 22:51]: > > * Jim Trocki <tr...@ar...> [2007-12-03 18:56]: > > >> > > >> I really don't want to bother you, but: any news on this upalertafter bug? > > >> :o) > > >> > > > > > > it'll be fixed this week. > > > > Ping :) > > Ping :) ICMP response from mon...@li...: developer unreachable |
From: Wolfram S. <li...@wo...> - 2008-02-06 17:53:06
|
* Wolfram Schlich <li...@wo...> [2008-01-29 22:51]: > * Jim Trocki <tr...@ar...> [2007-12-03 18:56]: > > On Fri, 30 Nov 2007, Wolfram Schlich wrote: > > > >> > >> I really don't want to bother you, but: any news on this upalertafter bug? > >> :o) > >> > > > > it'll be fixed this week. > > Ping :) Ping :) -- Regards, Wolfram Schlich <wsc...@ge...> Gentoo Linux * http://dev.gentoo.org/~wschlich/ |
From: Wolfram S. <li...@wo...> - 2008-01-29 21:50:20
|
* Jim Trocki <tr...@ar...> [2007-12-03 18:56]: > On Fri, 30 Nov 2007, Wolfram Schlich wrote: > >> >> I really don't want to bother you, but: any news on this upalertafter bug? >> :o) >> > > it'll be fixed this week. Ping :) -- Regards, Wolfram Schlich <wsc...@ge...> Gentoo Linux * http://dev.gentoo.org/~wschlich/ |
From: Jim T. <tr...@ar...> - 2008-01-29 20:00:04
|
On Tue, 29 Jan 2008, Jonathan deBoer wrote: > Which CVS version should I be following? Am I incorrect in thinking that > all new features should be implemented in the "Development" CVS branch? No, new features should go in "development". |
From: Jonathan <jdc...@gm...> - 2008-01-29 19:17:43
|
Hello All: I am looking to make some customizations to mon, and would like to contribute them back to the community. To that end, I would like to follow the latest development version of mon in CVS. Following the instructions on the website (http://mon.wiki.kernel.org/index.php/Development) I have checked out both the "Stable" and "Development" releases, to compare what the differences may be. During this comparison, I noticed that the TODO in the "Stable" release (1.2 branch) is much newer than the TODO in the "Development" release. Which CVS version should I be following? Am I incorrect in thinking that all new features should be implemented in the "Development" CVS branch? Thanks. Jonathan |
From: Jonathan d. <jon...@gm...> - 2008-01-29 19:15:44
|
Hello All: I am looking to make some customizations to mon, and would like to contribute them back to the community. To that end, I would like to follow the latest development version of mon in CVS. Following the instructions on the website (http://mon.wiki.kernel.org/index.php/Development) I have checked out both the "Stable" and "Development" releases, to compare what the differences may be. During this comparison, I noticed that the TODO in the "Stable" release (1.2 branch) is much newer than the TODO in the "Development" release. Which CVS version should I be following? Am I incorrect in thinking that all new features should be implemented in the "Development" CVS branch? Thanks. Jonathan |
From: Augie S. <aug...@gm...> - 2008-01-09 23:00:46
|
So this is a pretty hefty diff and I hope everyone is OK with it. Basically I needed the nntp monitor to recognize the difference between a real problem and a maintenance window; Diablo 'pauses' during this time, so I added a "-m" flag that does not see this state as a failure. Other changes I made while in there: Reworked the conditionals to handle an arbitrary number of cases. Enabled "strict". Added proper error reporting; push @failures $host and push @details "$host: Detail message." . Everything basically works the same and I have it running in production now against a cluster of about 10 different News servers. --Augie On Jan 9, 2008 2:47 PM, Augie Schwer <as...@us...> wrote: > Update of /cvsroot/mon/mon/mon.d > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7698 > > Modified Files: > nntp.monitor > Log Message: > Added a maintenance mode, propper error reporting and work in a 'use strict' environment. > > Index: nntp.monitor > =================================================================== > RCS file: /cvsroot/mon/mon/mon.d/nntp.monitor,v > retrieving revision 1.3 > retrieving revision 1.4 > diff -C2 -d -r1.3 -r1.4 > *** nntp.monitor 17 Jul 2007 18:03:17 -0000 1.3 > --- nntp.monitor 9 Jan 2008 22:47:49 -0000 1.4 > *************** > *** 9,13 **** > # For use with "mon". > # > ! # Arguments are "-p port -t timeout [-g group] [-f] host [host...] -u username -a password" > # > # This monitor connects to the NNTP server(s), checks for a greeting, logs in, > --- 9,13 ---- > # For use with "mon". > # > ! # Arguments are "[-m] -p port -t timeout [-g group] [-f] host [host...] -u username -a password" > # > # This monitor connects to the NNTP server(s), checks for a greeting, logs in, > *************** > *** 49,92 **** > use Getopt::Std; > use English; > > ! getopts ("fg:p:t:d:u:a:"); > ! $GROUP = $opt_g || 'control'; > ! $PORT = $opt_p || 119; > ! $TIMEOUT = $opt_t || 30; > ! $FEEDER = $opt_f; > ! $DEBUG = $opt_d || ""; > ! $USER = $opt_u || ''; > ! $PASS = $opt_a || ''; > ! > ! @failures = (); > ! > ! foreach $host (@ARGV) { > ! > ! if (! &nntpGET($host, $PORT)) { > ! push (@failures, $host); > ! } > ! } > ! > ! if (@failures == 0) { > ! exit 0; > ! } > ! > ! print join (" ", sort @failures), "\n"; > ! > ! exit 1; > ! > ! > ! sub nntpGET { > ! use Socket; > ! use Sys::Hostname; > > ! my($Server, $Port) = @_; > ! my($ServerOK, $TheContent); > > ! $ServerOK = 0; > > ! $TheContent = ''; > > ! $Path = '/'; > > ############################################################### > --- 49,74 ---- > use Getopt::Std; > use English; > + use Socket; > + use Sys::Hostname; > + use strict; > > ! getopts ("fg:p:t:d:u:a:m"); > ! our ($opt_g,$opt_p,$opt_t,$opt_f,$opt_u,$opt_a,$opt_m); > ! my $GROUP = $opt_g || 'control'; > ! my $PORT = $opt_p || 119; > ! my $TIMEOUT = $opt_t || 30; > ! my $FEEDER = $opt_f; > ! my $USER = $opt_u || ''; > ! my $PASS = $opt_a || ''; > ! my $MAINT = $opt_m; > > ! my @failures = (); > ! my @details = (); > > ! foreach my $host (@ARGV) { > > ! my $TheContent = ''; > > ! my $Path = '/'; > > ############################################################### > *************** > *** 95,115 **** > local $SIG{ALRM} = sub { die "Timeout Alarm" }; > alarm $TIMEOUT; > ! $result = &OpenSocket($Server, $Port); # Open a connection to the server > if ($result == 0) { # Failure to open the socket > ! print "Unable to open socket\n" if $DEBUG; > ! return ''; > } > > ! # > ! # welcome message > ! # > ! $in = <S>; > ! if ($in !~ /^2\d\d/) { > ! alarm 0; > ! print "No welcome message\n" if $DEBUG; > ! return 0; > } > > - if (!$FEEDER) { > if ($USER ne "") > { > --- 77,156 ---- > local $SIG{ALRM} = sub { die "Timeout Alarm" }; > alarm $TIMEOUT; > ! my $result = &OpenSocket($host, $PORT); # Open a connection to the server > if ($result == 0) { # Failure to open the socket > ! print "Host: $host\n"; > ! print "Port: $PORT\n"; > ! push @failures , $host; > ! push @details , "$host: Unable to open socket."; > ! alarm 0; > ! next; > } > > ! if ($FEEDER) > ! { > ! # welcome message > ! my $in = <S>; > ! if ($in !~ /^2\d\d/) { > ! alarm 0; > ! push @failures , $host; > ! push @details , "$host: No welcome message."; > ! next; > ! } > ! > ! print S "quit\r\n"; > ! > ! $in = <S>; > ! if ($in !~ /^2\d\d/) { > ! alarm 0; > ! push @failures , $host; > ! push @details , "$host: No response on 'quit' command."; > ! next; > ! } > ! > ! close(S); > ! alarm 0; # Cancel the alarm > } > + elsif ($MAINT) > + { > + # Is the server currently in a maintenance mode? > + my $in = <S>; > + if ( $in =~ /^502 .+ System currently paused.*/ ) > + { > + close(S); > + alarm 0; # Cancel the alarm > + } > + elsif ( $in =~ /^2\d\d/ ) # Server not in maintenance mode, but is accepting connections. > + { > + print S "quit\r\n"; > + > + $in = <S>; > + if ($in !~ /^2\d\d/) { > + alarm 0; > + push @failures , $host; > + push @details , "$host: No response on 'quit' command."; > + next; > + } > + > + close(S); > + alarm 0; # Cancel the alarm > + } > + else # Server is not OK. > + { > + alarm 0; > + push @failures , $host; > + push @details , "$host: Server is not accepting connections."; > + next; > + } > + } > + else { > + # welcome message > + my $in = <S>; > + if ($in !~ /^2\d\d/) { > + alarm 0; > + push @failures , $host; > + push @details , "$host: No welcome message."; > + next; > + } > > if ($USER ne "") > { > *************** > *** 118,124 **** > $in = <S>; > if ($in !~ /^381/) { > ! alarm 0; > ! print "No reaction to authinfo user\n" if $DEBUG; > ! return 0; > } > # password > --- 159,166 ---- > $in = <S>; > if ($in !~ /^381/) { > ! alarm 0; > ! push @failures , $host; > ! push @details , "$host: No reaction to authinfo user."; > ! next; > } > # password > *************** > *** 127,132 **** > if ($in !~ /^281/) { > alarm 0; > ! print "No reaction to authinfo pass or wrong password\n" if $DEBUG; > ! return 0; > } > } > --- 169,175 ---- > if ($in !~ /^281/) { > alarm 0; > ! push @failures , $host; > ! push @details , "$host: No reaction to authinfo pass or wrong password."; > ! next; > } > } > *************** > *** 139,144 **** > if ($in !~ /^2\d\d/) { > alarm 0; > ! print "Unable to perform 'mode reader'\n" if $DEBUG; > ! return 0; > } > > --- 182,188 ---- > if ($in !~ /^2\d\d/) { > alarm 0; > ! push @failures , $host; > ! push @details , "$host: Unable to perform 'mode reader'."; > ! next; > } > > *************** > *** 151,186 **** > if ($in !~ /^2\d\d/) { > alarm 0; > ! print "Unable to select group '$GROUP'\n" if $DEBUG; > ! return 0; > } > - } > - > - # > - # log out > - # > - print S "quit\r\n"; > > ! $in = <S>; > ! if ($in !~ /^2\d\d/) { > ! alarm 0; > ! print "No response on 'quit' command.\n" if $DEBUG; > ! return 0; > } > - > - $ServerOK = 1; > - > - close(S); > - alarm 0; # Cancel the alarm > - > }; > > if ($EVAL_ERROR and ($EVAL_ERROR =~ /^Timeout Alarm/)) { > ! print "**** Time Out\n"; > ! return 0; > } > - return $ServerOK; > > } > > sub OpenSocket { > # > --- 195,244 ---- > if ($in !~ /^2\d\d/) { > alarm 0; > ! push @failures , $host; > ! push @details , "$host: Unable to select group '$GROUP'."; > ! next; > ! } > ! # > ! # log out > ! # > ! print S "quit\r\n"; > ! $in = <S>; > ! if ($in !~ /^2\d\d/) { > ! alarm 0; > ! push @failures , $host; > ! push @details , "$host: No response on 'quit' command."; > ! next; > } > > ! close(S); > ! alarm 0; # Cancel the alarm > } > }; > > if ($EVAL_ERROR and ($EVAL_ERROR =~ /^Timeout Alarm/)) { > ! push @failures , $host; > ! push @details , "$host: Time Out."; > ! next; > ! } > ! } > ! > ! if (@failures) > ! { > ! print join (" ", sort @failures), "\n"; > ! > ! if (@details) > ! { > ! print join ("\n", @details), "\n"; > } > > + exit 1; > + } > + else > + { > + print "no failures\n"; > + exit 0; > } > > + > sub OpenSocket { > # > *************** > *** 188,194 **** > # on another (or this) host. Port can be a number or a named service > # > ! local($OtherHostname, $Port) = @_; > ! local($OurHostname, $sockaddr, $name, $aliases, $proto, $type, $len, > ! $ThisAddr, $that); > $OurHostname = &hostname; > > --- 246,252 ---- > # on another (or this) host. Port can be a number or a named service > # > ! my ($OtherHostname, $Port) = @_; > ! my ($OurHostname, $sockaddr, $name, $aliases, $proto, $type, $len, > ! $ThisAddr, $that, $OtherHostAddr); > $OurHostname = &hostname; > > *************** > *** 198,204 **** > ($name, $aliases, $type, $len, $OtherHostAddr) = gethostbyname($OtherHostname); > > ! my $that = sockaddr_in ($Port, $OtherHostAddr); > > ! $result = socket(S, &PF_INET, &SOCK_STREAM, $proto) || return undef; > > $result = connect(S, $that) || return undef; > --- 256,262 ---- > ($name, $aliases, $type, $len, $OtherHostAddr) = gethostbyname($OtherHostname); > > ! $that = sockaddr_in ($Port, $OtherHostAddr); > > ! my $result = socket(S, &PF_INET, &SOCK_STREAM, $proto) || return undef; > > $result = connect(S, $that) || return undef; > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Mon-commit mailing list > Mon...@li... > https://lists.sourceforge.net/lists/listinfo/mon-commit > -- Augie Schwer - Augie@Schwer.us - http://schwer.us Key fingerprint = 9815 AE19 AFD1 1FE7 5DEE 2AC3 CB99 2784 27B0 C072 |
From: Wolfram S. <li...@wo...> - 2008-01-07 07:32:21
|
* Jim Trocki <tr...@ar...> [2007-12-03 18:56]: > On Fri, 30 Nov 2007, Wolfram Schlich wrote: > >> >> I really don't want to bother you, but: any news on this upalertafter bug? >> :o) >> > > it'll be fixed this week. Happy new year! Any news on this one? :) Best regards, Wolfram |
From: Augie S. <aug...@gm...> - 2007-12-05 18:14:27
|
On Dec 5, 2007 6:19 AM, Jim Trocki <tr...@ar...> wrote: > On Mon, 3 Dec 2007, Augie Schwer wrote: > > > This was causing syslog messages to be silently discarded in modern > > versions of Perl; this should probably go into the 1.2 Stable Branch > > as well; what do you think Jim? > > Yes, it should go into the stable. > > Have a look at the diff below. > Does that make sense? Yup; I've checked it in to both the HEAD and the mon-1-2-branch and running it locally here; thanks Jim. -- Augie Schwer - Augie@Schwer.us - http://schwer.us Key fingerprint = 9815 AE19 AFD1 1FE7 5DEE 2AC3 CB99 2784 27B0 C072 |
From: Jim T. <tr...@ar...> - 2007-12-05 14:19:46
|
On Mon, 3 Dec 2007, Augie Schwer wrote: > This was causing syslog messages to be silently discarded in modern > versions of Perl; this should probably go into the 1.2 Stable Branch > as well; what do you think Jim? Yes, it should go into the stable. Have a look at the diff below. syslog may croak for a number of different reasons, so that's the reason for wrapping it in the eval. The % removal appears to be a safeguard for an exploit that was in older versions of the syslog module. I made the call to syslog in a way that would avoid the bug without having to remove the %s. It'll also log an error to "monerrfile" if the syslog fails for one reason or another. Does that make sense? diff -u -r1.22.2.2 mon --- mon 6 Jun 2007 11:46:19 -0000 1.22.2.2 +++ mon 5 Dec 2007 14:18:18 -0000 @@ -5392,11 +5392,13 @@ no warnings; # Redefining syslog sub syslog { - eval { - local $SIG{"__DIE__"}= sub { }; - my @log = map { s/\%//mg; } @_; - Sys::Syslog::syslog(@log); - } + return if (!@_); + + my $pri = (@_ == 1) ? "err" : shift; + + eval { Sys::Syslog::syslog ($pri, '%s', "@_"); }; + + print STDERR "syslog error: $@\n" if ($@ ne ""); } use warnings; |
From: Augie S. <aug...@gm...> - 2007-12-03 23:19:27
|
The mon.monitor would not complain if the remote mon was running but the scheduler was stopped; this fixes that problem. --Augie On 12/3/07, Augie Schwer <as...@us...> wrote: > Update of /cvsroot/mon/mon/mon.d > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18415/mon.d > > Modified Files: > mon.monitor > Log Message: > Making the mon monitor alert when the scheduler is not running. > > Index: mon.monitor > =================================================================== > RCS file: /cvsroot/mon/mon/mon.d/mon.monitor,v > retrieving revision 1.2 > retrieving revision 1.3 > diff -C2 -d -r1.2 -r1.3 > *** mon.monitor 17 Jul 2007 18:01:26 -0000 1.2 > --- mon.monitor 3 Dec 2007 23:18:05 -0000 1.3 > *************** > *** 62,65 **** > --- 62,72 ---- > > my @st = $c->list_state; > + if ($st[0] == 0) > + { > + push @failures, $host; > + push @details, "$host: scheduler stopped since " . localtime ($st[1]) . "\n"; > + undef $c; > + next; > + } > > if ($c->error ne "") > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Mon-commit mailing list > Mon...@li... > https://lists.sourceforge.net/lists/listinfo/mon-commit > -- Augie Schwer - Augie@Schwer.us - http://schwer.us Key fingerprint = 9815 AE19 AFD1 1FE7 5DEE 2AC3 CB99 2784 27B0 C072 |
From: Augie S. <aug...@gm...> - 2007-12-03 18:31:31
|
This was causing syslog messages to be silently discarded in modern versions of Perl; this should probably go into the 1.2 Stable Branch as well; what do you think Jim? --Augie On 12/3/07, Augie Schwer <as...@us...> wrote: > Update of /cvsroot/mon/mon > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7593 > > Modified Files: > mon > Log Message: > Fixing syslog dying in eval because of attempted write to read-only variable; bug 1803008 - patch from Andrew Eason. > > Index: mon > =================================================================== > RCS file: /cvsroot/mon/mon/mon,v > retrieving revision 1.23 > retrieving revision 1.24 > diff -C2 -d -r1.23 -r1.24 > *** mon 15 Jul 2007 13:21:48 -0000 1.23 > --- mon 3 Dec 2007 18:24:55 -0000 1.24 > *************** > *** 5395,5399 **** > eval { > local $SIG{"__DIE__"}= sub { }; > ! my @log = map { s/\%//mg; } @_; > Sys::Syslog::syslog(@log); > } > --- 5395,5402 ---- > eval { > local $SIG{"__DIE__"}= sub { }; > ! my @log = @_; > ! for ( @log ) { > ! s/\%//mg; > ! } > Sys::Syslog::syslog(@log); > } > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Mon-commit mailing list > Mon...@li... > https://lists.sourceforge.net/lists/listinfo/mon-commit > -- Augie Schwer - Augie@Schwer.us - http://schwer.us Key fingerprint = 9815 AE19 AFD1 1FE7 5DEE 2AC3 CB99 2784 27B0 C072 |
From: Wolfram S. <li...@wo...> - 2007-12-03 18:05:27
|
* Jim Trocki <tr...@ar...> [2007-12-03 18:56]: > On Fri, 30 Nov 2007, Wolfram Schlich wrote: > >> >> I really don't want to bother you, but: any news on this upalertafter bug? >> :o) >> > > it'll be fixed this week. Thanks, that's very nice to hear^Wread :) Is it possible to make some donation?! :) -- Regards, Wolfram Schlich <wsc...@ge...> Gentoo Linux * http://dev.gentoo.org/~wschlich/ |
From: Jim T. <tr...@ar...> - 2007-12-03 17:49:15
|
On Fri, 30 Nov 2007, Wolfram Schlich wrote: > > I really don't want to bother you, but: any news on this upalertafter bug? :o) > it'll be fixed this week. |
From: Augie S. <aug...@gm...> - 2007-12-01 00:47:42
|
This is just a modified mysql.monitor that checks a few vital variables to see if MySQL replication is still working; it's working well here at work. --Augie On 11/30/07, Augie Schwer <as...@us...> wrote: > Update of /cvsroot/mon/mon/mon.d > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14856 > > Added Files: > mysql-replication.monitor > Log Message: > Adding mysql-replication.monitor . > > --- NEW FILE: mysql-replication.monitor --- > #!/usr/bin/perl > # arguments: > # [ --username=username --password=password --port=# ] hostname(s) > > use DBI; > use Getopt::Long; > > my @details=(); > my @failures=(); > > GetOptions( \%options, "port=i", "username=s", "password=s" , "seconds=i" ); > > # uncomment these two lines and provide suitable information if you don't > # want to pass sensitive information on the command line > $options{username} ||= "repl-check"; > $options{password} ||= "m449kwf"; > $options{port} ||= 3306; > $options{seconds} ||= 3600; > > for $host( @ARGV ) { > my( $dbh ) = DBI->connect( "DBI:mysql:host=$host:port=$options{port}", $options{username}, $options{password}, { PrintError => 0 } ); > if( ! $dbh ) { > push( @failures, $host); > push( @details, "$host: Could not connect to MySQL server on $options{port}: " . $DBI::errstr . "\n"); > next; > } > > # Gather vital replication information. > my $sth = $dbh->prepare('SHOW SLAVE STATUS'); > $sth->execute; > my $slave = $sth->fetchrow_hashref; > $sth->finish; > > # Check those variables. > if ( $slave->{Slave_IO_Running} ne 'Yes' ) > { > push( @failures, $host); > push( @details, "$host: Slave IO thread is not running.\n"); > next; > } > > if ( $slave->{Slave_SQL_Running} ne 'Yes' ) > { > push( @failures, $host); > push( @details, "$host: Slave SQL thread is not running.\n"); > next; > } > > if ( $slave->{Seconds_Behind_Master} > $options{seconds} ) > { > push( @failures, $host); > push( @details, "$host: Slave is more than " . $options{seconds} . " seconds behind master.\n"); > next; > } > > $dbh->disconnect(); > } > > if (@failures) > { > print join (" ", sort @failures), "\n"; > print sort @details if (scalar @details > 0); > > exit 1; > > } > > else > { > exit 0; > } > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Mon-commit mailing list > Mon...@li... > https://lists.sourceforge.net/lists/listinfo/mon-commit > -- Augie Schwer - Augie@Schwer.us - http://schwer.us Key fingerprint = 9815 AE19 AFD1 1FE7 5DEE 2AC3 CB99 2784 27B0 C072 |
From: Augie S. <aug...@gm...> - 2007-12-01 00:46:16
|
I remember this bit us at work, so I put it into the head. Actually I did a big recursive diff (well kompare) and I think the whole 1.2 branch could just about overwrite the head; it looks like most of the new stuff has been going into the 1.2 branch and never making it into the head; mostly monitors in mon.d . Thoughts? On 11/30/07, Augie Schwer <as...@us...> wrote: > Update of /cvsroot/mon/mon/mon.d > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12387 > > Modified Files: > fping.monitor > Log Message: > Backporting bug fix from 1.2 branch > > Index: fping.monitor > =================================================================== > RCS file: /cvsroot/mon/mon/mon.d/fping.monitor,v > retrieving revision 1.3 > retrieving revision 1.4 > diff -C2 -d -r1.3 -r1.4 > *** fping.monitor 17 Apr 2005 07:42:27 -0000 1.3 > --- fping.monitor 1 Dec 2007 00:22:53 -0000 1.4 > *************** > *** 69,73 **** > { > chomp; > ! if (/^(\S+).*unreachable/i) > { > push (@unreachable, $1); > --- 69,73 ---- > { > chomp; > ! if (/^(\S+) is unreachable/i) > { > push (@unreachable, $1); > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Mon-commit mailing list > Mon...@li... > https://lists.sourceforge.net/lists/listinfo/mon-commit > -- Augie Schwer - Augie@Schwer.us - http://schwer.us Key fingerprint = 9815 AE19 AFD1 1FE7 5DEE 2AC3 CB99 2784 27B0 C072 |
From: Wolfram S. <li...@wo...> - 2007-11-30 10:01:03
|
* Jim Trocki <tr...@ar...> [2007-11-15 19:36]: > On Tue, 9 Oct 2007, Wolfram Schlich wrote: > >> 'upalertafter' is only supported for period definitions, not for >> service definitions itself. Despite that fact, process_event() >> (mon line 3365) looks for $sref->{"upalertafter"}, which obviously >> doesn't exist. > > correct. this is part of the bug. > >> A place where the code loops through the periods and where one >> could check it is within the do_alert() function. > > correct again. the upalertafter processing is being handled in the wrong > place. > a while back i had cleaned up the code to make the trap processing use the > same > squelch logic as the other processing by putting that in process_event. > this > fixed some trap bugs, and i had intended to do some more cleanup related to > that. so it does appear that the way to fix this is to rip out the > decisions to > call do_alert from process_event and stick them into do_alert. > >> Unfortunately, when you place the upalertafter check in there, >> it will only be run once, because process_event() already resets > > sure, just some minor details :) > > david, have you had a look at this yet, and have you formulated an opinion > on > this? i'll move on this, but just let us know if you have some ideas. Hi, I really don't want to bother you, but: any news on this upalertafter bug? :o) -- Regards, Wolfram Schlich <wsc...@ge...> Gentoo Linux * http://dev.gentoo.org/~wschlich/ |