From reinierk at utelisys.com Sun Sep 1 03:29:02 2002 From: reinierk at utelisys.com (Reinier F. Kleipool) Date: Sun Sep 1 03:29:02 2002 Subject: [Nagiosplug-devel] bugfix: check_smtp on MS exchange 2K servers Message-ID: <3173010086980641804E4D1FC4F69279122A89@allyourbase.testlab.utelisys.net> Hello developers, I had some trouble with check_smtp against a Microsoft Exchnage 2000 server. The plugin checked ALL my mailservers, except MS ex2K. I solved this by changing the SMTP_DUMMYCMD to the following definition: #define SMTP_DUMMYCMD "HELO nagios\r\nMAIL from:nagios at localhost\r\n" It turn out that *^%^# exchange 2K needs a valid HELO and MAIL command AND the \r 's to reply. If you don't, the read from the socket waits for ever, and times out. this returns a critical to nagios. This change does not break the checks with my other mailservers: sendmail and MS exchange 5.5.. Hope this helps.... Kind regards, Reinier Kleipool From sghosh at sghosh.org Sun Sep 1 06:44:44 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Sun Sep 1 06:44:44 2002 Subject: [Nagiosplug-devel] bugfix: check_smtp on MS exchange 2K servers In-Reply-To: <3173010086980641804E4D1FC4F69279122A89@allyourbase.testlab.utelisys.net> Message-ID: On Sun, 1 Sep 2002, Reinier F. Kleipool wrote: > Hello developers, > > I had some trouble with check_smtp against a Microsoft Exchnage 2000 > server. The plugin checked ALL my mailservers, except MS ex2K. I solved this > by changing the SMTP_DUMMYCMD to the following definition: > #define SMTP_DUMMYCMD "HELO nagios\r\nMAIL from:nagios at localhost\r\n" > It turn out that *^%^# exchange 2K needs a valid HELO and MAIL command AND > the \r 's to reply. If you don't, the read from the socket waits for ever, > and times out. this returns a critical to nagios. This change does not break > the checks with my other mailservers: sendmail and MS exchange 5.5.. > > Hope this helps.... > > Kind regards, > Reinier Kleipool > Thanks - -- -sg From sghosh at sghosh.org Sun Sep 1 09:03:21 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Sun Sep 1 09:03:21 2002 Subject: [Nagiosplug-devel] bugfix: check_smtp on MS exchange 2K servers In-Reply-To: Message-ID: > On Sun, 1 Sep 2002, Reinier F. Kleipool wrote: > > > Hello developers, > > > > I had some trouble with check_smtp against a Microsoft Exchnage 2000 > > server. The plugin checked ALL my mailservers, except MS ex2K. I solved this > > by changing the SMTP_DUMMYCMD to the following definition: > > #define SMTP_DUMMYCMD "HELO nagios\r\nMAIL from:nagios at localhost\r\n" > > It turn out that *^%^# exchange 2K needs a valid HELO and MAIL command AND > > the \r 's to reply. If you don't, the read from the socket waits for ever, > > and times out. this returns a critical to nagios. This change does not break > > the checks with my other mailservers: sendmail and MS exchange 5.5.. > > > > Hope this helps.... > > > > Kind regards, > > Reinier Kleipool > > > Hi Reinier The current CVS version does just what you have said, but slightly differently. SMTP_HELO is concatenated with the local hostname and "\r\n" to create the HELO statement For the MAIL command - rfc 821 allows the presence of a NULL reverse path (see ex 7) - does Exchange 2k complain about a null reverse path? SMTP_DUMMYCMD = "MAIL FROM:<> \r\n" -sg From sghosh at sghosh.org Sun Sep 1 09:08:16 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Sun Sep 1 09:08:16 2002 Subject: [Nagiosplug-devel] bugfix: check_smtp on MS exchange 2K servers In-Reply-To: Message-ID: On Sun, 1 Sep 2002, Subhendu Ghosh wrote: > > On Sun, 1 Sep 2002, Reinier F. Kleipool wrote: > > > > > Hello developers, > > > > > > I had some trouble with check_smtp against a Microsoft Exchnage 2000 > > > server. The plugin checked ALL my mailservers, except MS ex2K. I solved this > > > by changing the SMTP_DUMMYCMD to the following definition: > > > #define SMTP_DUMMYCMD "HELO nagios\r\nMAIL from:nagios at localhost\r\n" > > > It turn out that *^%^# exchange 2K needs a valid HELO and MAIL command AND > > > the \r 's to reply. If you don't, the read from the socket waits for ever, > > > and times out. this returns a critical to nagios. This change does not break > > > the checks with my other mailservers: sendmail and MS exchange 5.5.. > > > > > > Hope this helps.... > > > > > > Kind regards, > > > Reinier Kleipool > > > > > > > Hi Reinier > > The current CVS version does just what you have said, but slightly > differently. > > SMTP_HELO is concatenated with the local hostname and "\r\n" to create the > HELO statement > > > For the MAIL command - rfc 821 allows the presence of a NULL reverse path > (see ex 7) - does Exchange 2k complain about a null reverse path? > > SMTP_DUMMYCMD = "MAIL FROM:<> \r\n" Using a FROM argument in the MAIL command will create a log entry (at least in sendlmail. -- -sg From nagios at nagios.org Sun Sep 1 13:25:03 2002 From: nagios at nagios.org (Ethan Galstad) Date: Sun Sep 1 13:25:03 2002 Subject: [Nagiosplug-devel] bugfix: check_smtp on MS exchange 2K servers In-Reply-To: References: Message-ID: <3D70DFF1.17485.17E1A6D@localhost> It might make sense to make the dummy command string a command line option. If its not specified, default it to something standard. That way the user can always override it if they need to and we won't have to deal with finding a string that works 100% on all mail servers. What do you think? On 1 Sep 2002 at 12:02, Subhendu Ghosh wrote: [snip] > > Hi Reinier > > The current CVS version does just what you have said, but slightly > differently. > > SMTP_HELO is concatenated with the local hostname and "\r\n" to create the > HELO statement > > > For the MAIL command - rfc 821 allows the presence of a NULL reverse path > (see ex 7) - does Exchange 2k complain about a null reverse path? > > SMTP_DUMMYCMD = "MAIL FROM:<> \r\n" > > > -sg Ethan Galstad, Nagios Developer --- Email: nagios at nagios.org Website: http://www.nagios.org From sghosh at sghosh.org Sun Sep 1 17:04:21 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Sun Sep 1 17:04:21 2002 Subject: [Nagiosplug-devel] bugfix: check_smtp on MS exchange 2K servers In-Reply-To: <3D70DFF1.17485.17E1A6D@localhost> Message-ID: Sounds like a plan... -sg On Sat, 31 Aug 2002, Ethan Galstad wrote: > It might make sense to make the dummy command string a command line > option. If its not specified, default it to something standard. > That way the user can always override it if they need to and we won't > have to deal with finding a string that works 100% on all mail > servers. What do you think? > > > On 1 Sep 2002 at 12:02, Subhendu Ghosh wrote: > [snip] > > > > Hi Reinier > > > > The current CVS version does just what you have said, but slightly > > differently. > > > > SMTP_HELO is concatenated with the local hostname and "\r\n" to create the > > HELO statement > > > > > > For the MAIL command - rfc 821 allows the presence of a NULL reverse path > > (see ex 7) - does Exchange 2k complain about a null reverse path? > > > > SMTP_DUMMYCMD = "MAIL FROM:<> \r\n" > > > > > > -sg > > > Ethan Galstad, > Nagios Developer > --- > Email: nagios at nagios.org > Website: http://www.nagios.org > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > -- From administrator at net-and-works.de Mon Sep 2 02:45:57 2002 From: administrator at net-and-works.de (administrator at net-and-works.de) Date: Mon Sep 2 02:45:57 2002 Subject: [Nagiosplug-devel] time problem with passive service checks Message-ID: Hi, first, there is an inconsistant description of freshness checks in the documentation. the freshness_threshold must be given in seconds, but the freshness.html says: if set to 5 and interval_length is set to 60 then it will be 5 minutes. this isn't true. see paragraph "How The Freshness Threshold Works" the same wrong description is given on the page distributed.html paragraph "Freshness Checking". second: I'm providing some passive service checks to nagios without using nsca. the check time is provided by the remote host. the check is executed every 5 minutes and freshness_threshold is set to 10 minutes. the problem is, that the remote hosts time isn't synchronized with the nagios hosts time. if the remote hosts time is more then 10 minutes after the nagios time, then the service states will flap all the time, because each incoming passive service check result is detected to be stale. this could be solved by synchronizing the times with NTP, but which way should be used if NTP isn't possible. How does NSCA handle this? As a workaround i do not use the check time from the remote host, but replace it with the local time when passing the result into the external command file. any suggestions about a better solution? martin From ghelleks at yahoo.com Mon Sep 2 22:13:02 2002 From: ghelleks at yahoo.com (Gunnar Hellekson) Date: Mon Sep 2 22:13:02 2002 Subject: [Nagiosplug-devel] Spaces in arguments? Message-ID: I've pored through the Nagios code, posted questions, and tried to find working examples. I'm starting to think I'm stupid. I've written a plugin which takes, among other things, a string containing spaces. define command { command_name my_plugin command_line $USER1$/my_plugin -C '$ARG1$' -T $ARG2$ } define service { host_name my-host service_description buggy-service use generic-service check_command my_plugin!A String With Spaces!AnotherValue } Running this as nagios works, of course: ./my_plugin -C 'A String With Spaces' -T AnotherValue When run in Nagios, it behaves as if: ./my_plugin -C \'A String With Spaces\' -T AnotherValue In other words, argv is: 0 == ./my_plugin 1 == -C 2 == 'A 3 == String etc. I have tried: * wrapping $ARG1$ in both (') and (") characters * wrapping $ARG1$ in escaped quotes (\'), (\") * wrapping the first argument in the service declaration (A String...) in ('), (") and escaped quotes (\'), (\") In every case, the command is executed as if each word of $ARG1$ is a seperate argument. This is with Nagios 1.0b5, Solaris 2.6. The documentation to popen() and Nagios tell me that I should have to, at most, place a single quote (') around the $ARG1$ string in the check_command directive. Yet, no joy. Can anyone confirm this? Has anyone been able to get arguments containing spaces fed into their plugins? I would recompile with DEBUG1 so I could see the raw_command and processed_command, but nagios dumps core each time I've tried. Anyone? From jan.david.jd at belgium.agfa.com Tue Sep 3 00:28:02 2002 From: jan.david.jd at belgium.agfa.com (Jan David) Date: Tue Sep 3 00:28:02 2002 Subject: [Nagiosplug-devel] Spaces in arguments? Message-ID: You can't fix it. I've posted a very similar note on the Netsaint plugin development list just a couple of days ago. Apparantly this issue has been around for some time. The only way to solve it is to dig into the code and write a patch. This is obviously not the most rapid solution, so in the meantime, I suggest you forget about spaces and use hyphens or underscores for now. Regards, J. David Gunnar Hellekson @lists.sourceforge.net on 09/03/2002 07:12:05 AM Sent by: nagiosplug-devel-admin at lists.sourceforge.net To: nagiosplug-devel cc: Subject: [Nagiosplug-devel] Spaces in arguments? I've pored through the Nagios code, posted questions, and tried to find working examples. I'm starting to think I'm stupid. I've written a plugin which takes, among other things, a string containing spaces. define command { command_name my_plugin command_line $USER1$/my_plugin -C '$ARG1$' -T $ARG2$ } define service { host_name my-host service_description buggy-service use generic-service check_command my_plugin!A String With Spaces!AnotherValue } Running this as nagios works, of course: ./my_plugin -C 'A String With Spaces' -T AnotherValue When run in Nagios, it behaves as if: ./my_plugin -C \'A String With Spaces\' -T AnotherValue In other words, argv is: 0 == ./my_plugin 1 == -C 2 == 'A 3 == String etc. I have tried: * wrapping $ARG1$ in both (') and (") characters * wrapping $ARG1$ in escaped quotes (\'), (\") * wrapping the first argument in the service declaration (A String...) in ('), (") and escaped quotes (\'), (\") In every case, the command is executed as if each word of $ARG1$ is a seperate argument. This is with Nagios 1.0b5, Solaris 2.6. The documentation to popen() and Nagios tell me that I should have to, at most, place a single quote (') around the $ARG1$ string in the check_command directive. Yet, no joy. Can anyone confirm this? Has anyone been able to get arguments containing spaces fed into their plugins? I would recompile with DEBUG1 so I could see the raw_command and processed_command, but nagios dumps core each time I've tried. Anyone? ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 _______________________________________________ Nagiosplug-devel mailing list Nagiosplug-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel From Volker.Aust at premiere.de Tue Sep 3 04:25:03 2002 From: Volker.Aust at premiere.de (Volker.Aust at premiere.de) Date: Tue Sep 3 04:25:03 2002 Subject: [Nagiosplug-devel] Spaces in arguments? Message-ID: I have notice this only when Nagios is compiled with embedded perl. Without embedded perl Nagios calls a shell which is calling the plugin. And the shell does pay attention to single or double quotes. With embedded perl Nagos calls the plugin directly and does not pay attention to single or double quotes. For my plugin that needs arguments with spaces I have decide to URL-encode spaces (and percent signs, eg. A%20String%20With%20Spaces) and to URL-decode it in the script with: # this RE come's from uri_unescape() from the module URI::Escape $service =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; Hope this helps. -vol > -----Original Message----- > From: Jan David [mailto:jan.david.jd at belgium.agfa.com] > Sent: Tuesday, September 03, 2002 9:27 AM > To: Gunnar Hellekson Cc: nagiosplug-devel > Subject: Re: [Nagiosplug-devel] Spaces in arguments? > > > > You can't fix it. I've posted a very similar note on the > Netsaint plugin > development list just a couple of days ago. Apparantly this > issue has been > around for some time. The only way to solve it is to dig into > the code and > write a patch. This is obviously not the most rapid solution, > so in the > meantime, I suggest you forget about spaces and use hyphens > or underscores > for now. > > Regards, > > J. David > > > > > > Gunnar Hellekson @lists.sourceforge.net > on 09/03/2002 > 07:12:05 AM > > Sent by: nagiosplug-devel-admin at lists.sourceforge.net > > > To: nagiosplug-devel > cc: > Subject: [Nagiosplug-devel] Spaces in arguments? > > > I've pored through the Nagios code, posted questions, and > tried to find > working examples. I'm starting to think I'm stupid. I've > written a plugin > which takes, among other things, a string containing spaces. > > define command { > command_name my_plugin > command_line $USER1$/my_plugin -C '$ARG1$' -T $ARG2$ > } > > define service { > host_name my-host > service_description buggy-service > use generic-service > check_command my_plugin!A String With Spaces!AnotherValue > } > > Running this as nagios works, of course: > > ./my_plugin -C 'A String With Spaces' -T AnotherValue > > When run in Nagios, it behaves as if: > > ./my_plugin -C \'A String With Spaces\' -T AnotherValue > > In other words, argv is: > 0 == ./my_plugin > 1 == -C > 2 == 'A > 3 == String > etc. > > > I have tried: > > * wrapping $ARG1$ in both (') and (") characters > * wrapping $ARG1$ in escaped quotes (\'), (\") > * wrapping the first argument in the service declaration > (A String...) > in ('), (") and escaped quotes (\'), (\") > > In every case, the command is executed as if each word of $ARG1$ > is a seperate argument. > > This is with Nagios 1.0b5, Solaris 2.6. The documentation to popen() > and Nagios tell me that I should have to, at most, place a > single quote (') > around the $ARG1$ string in the check_command directive. Yet, no > joy. > > Can anyone confirm this? Has anyone been able to get arguments > containing spaces fed into their plugins? > > I would recompile with DEBUG1 so I could see the raw_command and > processed_command, but nagios dumps core each time I've tried. > > Anyone? > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > From sghosh at sghosh.org Tue Sep 3 06:08:01 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Tue Sep 3 06:08:01 2002 Subject: [Nagiosplug-devel] Spaces in arguments? In-Reply-To: Message-ID: Put the quotes on the service definition - NOT the command definition. -sg On Tue, 3 Sep 2002, Gunnar Hellekson wrote: > > I've pored through the Nagios code, posted questions, and tried to find > working examples. I'm starting to think I'm stupid. I've written a plugin > which takes, among other things, a string containing spaces. > > define command { > command_name my_plugin > command_line $USER1$/my_plugin -C '$ARG1$' -T $ARG2$ > } > > define service { > host_name my-host > service_description buggy-service > use generic-service > check_command my_plugin!A String With Spaces!AnotherValue > } > > Running this as nagios works, of course: > > ./my_plugin -C 'A String With Spaces' -T AnotherValue > > When run in Nagios, it behaves as if: > > ./my_plugin -C \'A String With Spaces\' -T AnotherValue > > In other words, argv is: > 0 == ./my_plugin > 1 == -C > 2 == 'A > 3 == String > etc. > > > I have tried: > > * wrapping $ARG1$ in both (') and (") characters > * wrapping $ARG1$ in escaped quotes (\'), (\") > * wrapping the first argument in the service declaration (A String...) > in ('), (") and escaped quotes (\'), (\") > > In every case, the command is executed as if each word of $ARG1$ > is a seperate argument. > > This is with Nagios 1.0b5, Solaris 2.6. The documentation to popen() > and Nagios tell me that I should have to, at most, place a single quote (') > around the $ARG1$ string in the check_command directive. Yet, no > joy. > > Can anyone confirm this? Has anyone been able to get arguments > containing spaces fed into their plugins? > > I would recompile with DEBUG1 so I could see the raw_command and > processed_command, but nagios dumps core each time I've tried. > > Anyone? > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > -- From ghelleks at yahoo.com Tue Sep 3 07:14:02 2002 From: ghelleks at yahoo.com (Gunnar Hellekson) Date: Tue Sep 3 07:14:02 2002 Subject: [Nagiosplug-devel] Spaces in arguments? In-Reply-To: Message-ID: > From: Subhendu Ghosh > Date: Tue, 3 Sep 2002 09:06:58 -0400 (EDT) > To: nagiosplug-devel > Subject: Re: [Nagiosplug-devel] Spaces in arguments? > > > Put the quotes on the service definition - NOT the command definition. As I said, I tried that. It makes no difference. The other two posters are correct. What bugs me is that I can't find anything in checks.c that would cause this behavior. In any case, a documentation update or a patch seems to be in order. Is this more appropriate for the nagios-devel list? -Gunnar From jsellens at generalconcepts.com Tue Sep 3 08:02:03 2002 From: jsellens at generalconcepts.com (John Sellens) Date: Tue Sep 3 08:02:03 2002 Subject: [Nagiosplug-devel] Spaces in arguments? Message-ID: <200209031500.g83F0vN85602@gc0.generalconcepts.com> | From: Volker.Aust at premiere.de | | I have notice this only when Nagios is compiled with embedded perl. Without | embedded perl Nagios calls a shell which is calling the plugin. And the | shell does pay attention to single or double quotes. With embedded perl | Nagos calls the plugin directly and does not pay attention to single or | double quotes. Ah - quite right. And just to add to this, this is true only if it uses the embedded perl interpreter for the plugin, which happens if the first 80 characters of the plugin executable contain the string "/bin/perl". I think you could force nagios to not use the embedded perl interpreter for a particular command with a command definition something like (my perl command line knowledge is a little rusty): command_line /usr/local/bin/perl -- $USER1$/my_plugin -C '$ARG1$' -T $ARG2$ It would likely be a little slower though. | From: Subhendu Ghosh | | Put the quotes on the service definition - NOT the command definition. I think the quotes might be better in the command definition, because then you likely won't see quotes showing up in the service displays in the web interface(?). Cheers John jsellens at generalconcepts.com From guy.vandenbergh at belnet.be Wed Sep 4 10:48:06 2002 From: guy.vandenbergh at belnet.be (Guy Van Den Bergh) Date: Wed Sep 4 10:48:06 2002 Subject: [Nagiosplug-devel] network management plugins Message-ID: <1031161664.28866.16.camel@guy.fw.belnet.be> Hi guys, I've written a few plugins useful for network management. They all written in perl, and using snmp for talking to the routers. They are in attachment: check_xinterface: an 'extended' plugin for monitoring router interfaces via snmp. It only uses standard mibs for maximum vendor independence. check_cisco_env: for monitoring environment of cisco routers (temperature, power supply, ...) check_juniper_env: about the same for juniper routers. They perform well in a production environment, but I've had some memory leaks when using the embedded perl interpreter. So I've switched off the interpreter :) Take a look at it and maybe they are useful for the main plugin distribution. Off course any comments are welcome... Best regards, -- Guy Van Den Bergh BELNET -- Network Engineer Wetenschapsstraat 4 B-1000 Brussel Tel. +32 2 790.33.33 Fax. +32 2 790.33.34 -------------- next part -------------- #!/usr/bin/perl -wT # # check_xinterface - nagios plugin # # largely based upon check_ifoperstatus.pl plugin by Christoph Kron # # # # # Copyright (C) 2002 Guy Van Den Bergh # # 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. # # # Report bugs to: guy at belnet.be # # design of the plugin: # check admin status: if down, then warning; exit # check operational status: if down, then critical; exit # check last change, if within 'tolerance' (-l or --last-change option), # then warning # get performance data: bits in/out, etc... (implementation to be scheduled later) # performance data could be checked against older values (bw drops e.g.) use strict; use Net::SNMP; use Getopt::Long; &Getopt::Long::config('auto_abbrev'); my $status; my $TIMEOUT = 60; my %ERRORS = ('UNKNOWN' , '-1', 'OK' , '0', 'WARNING', '1', 'CRITICAL', '2'); my %ciscoEnvMonState = ('1','normal(1)', '2','warning(2)', '3','critical(3)', '4','shutdown(4)', '5','notPresent(5)', '6','notFunctioning(6)'); my $state = "UNKNOWN"; my $answer = ""; my $snmpkey = 1; my $community = "public"; my $port = 161; my $t_oid; my @snmpoids; my %error_oids; my $snmpCiscoVoltageStatus; my $snmpCiscoTemperatureStatus; my $snmpCiscoFanStatus; my $snmpCiscoSupplyStatus; my $hostname; my $session; my $error; my $response; my $value; my $oid; my @voltage_errors; my @temperature_errors; my @fan_errors; my @supply_errors; sub usage { printf "\nMissing arguments!\n"; printf "\n"; printf "Perl Check Cisco Environment plugin for Nagios\n"; printf "checks status of temperature, fans, ...\n"; printf "usage: \n"; printf "check_cisco_env -c -p "; printf "\nCopyright (C) 2002 Guy Van Den Bergh\n"; printf "check_cisco_env comes with ABSOLUTELY NO WARRANTY\n"; printf "This programm is licensed under the terms of the "; printf "GNU General Public License\n(check source code for details)\n"; printf "\n\n"; exit $ERRORS{"UNKNOWN"}; } # Just in case of problems, let's not hang Nagios $SIG{'ALRM'} = sub { print ("ERROR: No snmp response from $hostname (alarm)\n"); exit $ERRORS{"UNKNOWN"}; }; alarm($TIMEOUT); $status = GetOptions("community=s",\$community, "port=i",\$port); if ($status == 0) { &usage; } #shift; $hostname = shift || &usage; ($session, $error) = Net::SNMP->session( -hostname => $hostname, -community => $community, -port => $port ); if (!defined($session)) { $state='UNKNOWN'; $answer=$error; print ("$state: $answer"); exit $ERRORS{$state}; } $snmpCiscoVoltageStatus = '.1.3.6.1.4.1.9.9.13.1.2.1.7'; $snmpCiscoTemperatureStatus = '.1.3.6.1.4.1.9.9.13.1.3.1.6'; $snmpCiscoFanStatus = '.1.3.6.1.4.1.9.9.13.1.4.1.3'; $snmpCiscoSupplyStatus = '.1.3.6.1.4.1.9.9.13.1.5.1.3'; push(@snmpoids,$snmpCiscoVoltageStatus); push(@snmpoids,$snmpCiscoTemperatureStatus); push(@snmpoids,$snmpCiscoFanStatus); push(@snmpoids,$snmpCiscoSupplyStatus); # # These four oids all have the same syntax, # which makes it easy for scripting all four oids at the same time! # $answer = "No data returned (Environment MIB not supported)"; # This will be overwritten when there IS data returned! TABLE: foreach $t_oid (@snmpoids) { # # Now get all relevant oids, and set the plugin output status accordingly. # if (!defined($response = $session->get_table($t_oid))) { $error_oids{$t_oid} = $session->error; next TABLE; } while ( ($oid, $value) = each %$response ) { if ($value == 1 || $value == 5 || $value == 6) { # normal, notPresent or notFunctioning $state = 'OK' if $state =~ /UNKNOWN/; $answer = "All environment variables normal." if $state eq 'OK'; } elsif ($value == 2) { # warning $error_oids{$oid} = $ciscoEnvMonState{$value}; $state = 'WARNING' unless $state =~ /CRITICAL/; } elsif ($value == 3 || $value == 4) { # critical or shutdown $error_oids{$oid} = $ciscoEnvMonState{$value}; $state = 'CRITICAL' } } } $session->close; ## Here is the place for introducing artificial errors (for debugging). # # Now parse all erroneous responses: # unless ($state eq 'OK' or $state eq 'UNKNOWN') { while ( ($oid, $value) = each %error_oids ) { $value =~ s/\(\d\)//; if ($oid =~ /$snmpCiscoVoltageStatus\./) { $oid =~ s/$snmpCiscoVoltageStatus\.//; push(@voltage_errors, "$value (instance $oid)"); } elsif($oid =~ /$snmpCiscoTemperatureStatus\./) { $oid =~ s/$snmpCiscoTemperatureStatus\.//; push(@temperature_errors, "$value (instance $oid)"); } elsif ($oid =~ /$snmpCiscoFanStatus\./) { $oid =~ s/$snmpCiscoFanStatus\.//; push(@fan_errors, "$value (fan $oid)"); } elsif ($oid =~ /$snmpCiscoSupplyStatus\./) { $oid =~ s/$snmpCiscoSupplyStatus\.//; push(@supply_errors, "$value (PS $oid)"); } } # # And now the final formatting of the output: # my $voltage_errors_s = join ";", @voltage_errors if defined $voltage_errors[0]; my $temperature_errors_s = join ";", @temperature_errors if defined $temperature_errors[0]; my $fan_errors_s = join ";", @fan_errors if defined $fan_errors[0]; my $supply_errors_s = join ";", @supply_errors if defined $supply_errors[0]; $answer = "Problems with:
"; $answer .= "Voltage: " . $voltage_errors_s . "
" if defined $voltage_errors_s; $answer .= "Temperature: " . $temperature_errors_s . "
" if defined $temperature_errors_s; $answer .= "Fans: " . $fan_errors_s . "
" if defined $fan_errors_s; $answer .= "Power Supply: " . $supply_errors_s ."
" if defined $supply_errors_s; } print ("$answer\n"); exit $ERRORS{$state}; -------------- next part -------------- #!/usr/bin/perl -wT # # check_juniper_env - nagios plugin # # largely based upon check_ifoperstatus.pl plugin by Christoph Kron # # # # # Copyright (C) 2002 Guy Van Den Bergh # # 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. # # # Report bugs to: guy at belnet.be # # design of the plugin: # check admin status: if down, then warning; exit # check operational status: if down, then critical; exit # check last change, if within 'tolerance' (-l or --last-change option), # then warning # get performance data: bits in/out, etc... (implementation to be scheduled later) # performance data could be checked against older values (bw drops e.g.) use strict; use Net::SNMP; use Getopt::Long; &Getopt::Long::config('auto_abbrev'); my $status; my $TIMEOUT = 15; my %ERRORS = ('UNKNOWN' , '-1', 'OK' , '0', 'WARNING', '1', 'CRITICAL', '2'); my %jnxOperatingState = ('1','unknown(1)', '2','running(2)', '3','ready(3)', '4','reset(4)', '5','runningAtFullSpeed(5)', '6','down(6)', '7','standby(7)'); my $state = "UNKNOWN"; my $answer = ""; my $snmpkey = 1; my $community = "public"; my $port = 161; my $t_oid; my %error_oids; my $snmpJnxOperatingDescr; my $snmpJnxOperatingState; my $snmpJnxOperatingTemp; my $snmpJnxOperatingCPU; my $hostname; my $session; my $error; my $response; my $temp_w; my $temp_c; my $cpu_w; my $cpu_c; my $value; my $descr; my $oid; my @state_errors; my @temp_errors; my @cpu_errors; sub usage { printf "\nMissing arguments!\n"; printf "\n"; printf "Perl Check Juniper Environment plugin for Nagios\n"; printf "checks status of temperature, fans, ...\n"; printf "usage: \n"; printf "check_juniper_env --community --port --temp --load "; printf "\nCopyright (C) 2002 Guy Van Den Bergh\n"; printf "check_juniper_env comes with ABSOLUTELY NO WARRANTY\n"; printf "This programm is licensed under the terms of the "; printf "GNU General Public License\n(check source code for details)\n"; printf "\n\n"; exit $ERRORS{"UNKNOWN"}; } # Just in case of problems, let's not hang Nagios $SIG{'ALRM'} = sub { print ("ERROR: No snmp response from $hostname (alarm)\n"); exit $ERRORS{"UNKNOWN"}; }; alarm($TIMEOUT); $status = GetOptions("community=s",\$community, "port=i",\$port, "temp=s",\$temp_w, "load=s",\$cpu_w); if ($status == 0) { &usage; } if ($temp_w =~ /\d+:\d+/ and $cpu_w =~ /\d+:\d+/) { ($temp_w, $temp_c) = split /:/, $temp_w; ($cpu_w, $cpu_c) = split /:/, $cpu_w; if ($temp_w > $temp_c) { print "Critical temp is below warning level\n\n"; &usage; } elsif ($cpu_w > $cpu_c) { print "Critical CPU is below warning level\n\n"; &usage; } } else { &usage; } #shift; $hostname = shift || &usage; ($session, $error) = Net::SNMP->session( -hostname => $hostname, -community => $community, -port => $port ); if (!defined($session)) { $state='UNKNOWN'; $answer=$error; print ("$state: $answer"); exit $ERRORS{$state}; } $snmpJnxOperatingDescr = '.1.3.6.1.4.1.2636.3.1.13.1.5'; $snmpJnxOperatingState = '.1.3.6.1.4.1.2636.3.1.13.1.6'; $snmpJnxOperatingTemp = '.1.3.6.1.4.1.2636.3.1.13.1.7'; $snmpJnxOperatingCPU = '.1.3.6.1.4.1.2636.3.1.13.1.8'; $answer = "No data returned (Environment MIB not supported)"; # This will be overwritten when there IS data returned! # # get all jnxOperatingState values (see %jnxOperatingState). # if (!defined($response = $session->get_table($snmpJnxOperatingState))) { $error_oids{$snmpJnxOperatingState} = $session->error; } while ( ($oid, $value) = each %$response ) { if ($value == 1 || $value == 2 || $value == 3 || $value == 7) { # unknown, running, ready or standby $state = 'OK' if $state =~ /UNKNOWN/; $answer = "All environment variables normal." if $state =~ /UNKNOWN/; } elsif ($value == 4 || $value == 5) { # reset or runningAtFullSpeed $error_oids{$oid} = $jnxOperatingState{$value}; $state = 'WARNING' unless $state =~ /CRITICAL/; } elsif ($value == 6) { # down $error_oids{$oid} = $jnxOperatingState{$value}; $state = 'CRITICAL' } } # # get all temperature values # if (!defined($response = $session->get_table($snmpJnxOperatingTemp))) { $error_oids{$snmpJnxOperatingTemp} = $session->error; } while ( ($oid, $value) = each %$response ) { if ($value < $temp_w) { $state = 'OK' if $state =~ /UNKNOWN/; $answer = "All environment variables normal." if $state =~ /UNKNOWN/; } elsif ($value < $temp_c) { $error_oids{$oid} = " $value ?C"; $state = 'WARNING' unless $state =~ /CRITICAL/; } else { $error_oids{$oid} = " $value ?C"; $state = 'CRITICAL' } } # # get all cpu values # if (!defined($response = $session->get_table($snmpJnxOperatingCPU))) { $error_oids{$snmpJnxOperatingCPU} = $session->error; } while ( ($oid, $value) = each %$response ) { if ($value < $cpu_w) { $state = 'OK' if $state =~ /UNKNOWN/; $answer = "All environment variables normal." if $state =~ /UNKNOWN/; } elsif ($value < $cpu_c) { $error_oids{$oid} = " $value%"; $state = 'WARNING' unless $state =~ /CRITICAL/; } else { $error_oids{$oid} = " $value%"; $state = 'CRITICAL' } } ## Here is the place for introducing artificial errors (for debugging). unless ($state eq 'OK' or $state eq 'UNKNOWN') { while ( ($oid, $value) = each %error_oids ) { if ($oid =~ /$snmpJnxOperatingState\./) { $value =~ s/\(\d\)//; $oid =~ s/$snmpJnxOperatingState\.//; if ($response = $session->get_request($snmpJnxOperatingDescr.".$oid")) { $descr = $$response{$snmpJnxOperatingDescr.".$oid"}; } else { $descr = "instance $oid"; } push(@state_errors, "$descr is $value"); } elsif ($oid =~ /$snmpJnxOperatingTemp\./) { $oid =~ s/$snmpJnxOperatingTemp\.//; if ($response = $session->get_request($snmpJnxOperatingDescr.".$oid")) { $descr = $$response{$snmpJnxOperatingDescr.".$oid"}; } else { $descr = "instance $oid"; } push(@temp_errors, " $descr : $value"); } elsif ($oid =~ /$snmpJnxOperatingCPU\./) { $oid =~ s/$snmpJnxOperatingCPU\.//; if ($response = $session->get_request($snmpJnxOperatingDescr.".$oid")) { $descr = $$response{$snmpJnxOperatingDescr.".$oid"}; } else { $descr = "instance $oid"; } push(@cpu_errors, " $descr : $value"); } } my $state_errors_s = join ";", @state_errors if defined $state_errors[0]; my $temp_errors_s = join ";", @temp_errors if defined $temp_errors[0]; my $cpu_errors_s = join ";", @cpu_errors if defined $cpu_errors[0]; $answer = "Problems with:
"; $answer .= "State: " . $state_errors_s . "
" if defined $state_errors_s; $answer .= "Temperature: " . $temp_errors_s . "
" if defined $temp_errors_s; $answer .= "CPU: " . $cpu_errors_s . "
" if defined $cpu_errors_s; $session->close; } print ("$answer\n"); exit $ERRORS{$state}; -------------- next part -------------- #!/usr/bin/perl -wT # # check_xinterface - nagios plugin # # largely based upon check_ifoperstatus.pl plugin by Christoph Kron # # # # # Copyright (C) 2002 Guy Van Den Bergh # # 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. # # # Report bugs to: guy at belnet.be # # design of the plugin: # get index for interface from -i option (format: ::) # check whether ifName matches ifIndex: if not: warning; exit # check admin status: if down, then warning; exit # check operational status: if down, then critical; exit # check last change, if within 'tolerance' (-l or --last-change option), # then warning # get performance data: bits in/out, etc... (implementation to be scheduled later) # performance data could be checked against older values (bw drops e.g.) use strict; use Net::SNMP; use Getopt::Long; &Getopt::Long::config('auto_abbrev'); my @cmdline = @ARGV; my $status; my $TIMEOUT = 15; my %ERRORS = ('OK' , '0', 'WARNING', '1', 'CRITICAL', '2', 'UNKNOWN', '3'); my %ifOperStatus = ('1','up', '2','down', '3','testing', '4','unknown', '5','dormant', '6','notPresent'); my $state = "UNKNOWN"; my $answer = "(No output. Bug?)"; my $ifName; my $ifIndex; my $ifDescr; my $community = "public"; my $port = 161; my @snmpoids; my $snmpIfName; my $snmpIfDescr; my $snmpIfAlias; my $snmpIfAdminStatus; my $snmpIfOperStatus; my $hostname; my $session; my $error; my $response; sub usage { printf "\nMissing arguments!\n"; printf "\n"; printf "Perl eXtended Check Interface plugin for Nagios\n"; printf "checks status of specified interface\n"; printf "When the interface state changed within the last check interval, a WARNING is returned. \n\n"; printf "usage: \n"; printf "check_xinterface -i -n -c -p \n"; printf "\nCopyright (C) 2002 Guy Van Den Bergh\n"; printf "check_xinterface comes with ABSOLUTELY NO WARRANTY\n"; printf "This programm is licensed under the terms of the "; printf "GNU General Public License\n(check source code for details)\n"; printf "\n\n"; exit $ERRORS{"UNKNOWN"}; } # Just in case of problems, let's not hang Nagios $SIG{'ALRM'} = sub { print ("ERROR: No snmp response from $hostname (alarm)\n"); exit $ERRORS{"UNKNOWN"}; }; alarm($TIMEOUT); $status = GetOptions("index=s",\$ifIndex, "name=s",\$ifName, "community=s",\$community, "port:i",\$port); if ($status == 0) { &usage; } if (not defined $ifIndex) { print ("ERROR: No snmp ifIndex supplied (@cmdline)\n"); exit $ERRORS{"UNKNOWN"}; } if (not defined $ifName) { print ("ERROR: No snmp ifName supplied (@cmdline)\n"); exit $ERRORS{"UNKNOWN"}; } $hostname = shift || &usage; ($session, $error) = Net::SNMP->session( -hostname => $hostname, -community => $community, -port => $port ); if (!defined($session)) { $state='UNKNOWN'; $answer=$error; print ("$state: $answer"); exit $ERRORS{$state}; } $snmpIfAdminStatus = '.1.3.6.1.2.1.2.2.1.7.' . $ifIndex; $snmpIfOperStatus = '.1.3.6.1.2.1.2.2.1.8.' . $ifIndex; $snmpIfName = '.1.3.6.1.2.1.31.1.1.1.1.' . $ifIndex; $snmpIfDescr = '.1.3.6.1.2.1.2.2.1.2.' . $ifIndex; $snmpIfAlias = '.1.3.6.1.2.1.31.1.1.1.18.' . $ifIndex; push(@snmpoids,$snmpIfName); push(@snmpoids,$snmpIfDescr); push(@snmpoids,$snmpIfAdminStatus); push(@snmpoids,$snmpIfOperStatus); if (!defined($response = $session->get_request(@snmpoids))) { $answer=$session->error; $session->close; $state = 'WARNING'; print ("$state: SNMP error: $answer\n"); exit $ERRORS{$state}; } if ( not ($response->{$snmpIfName} eq $ifName) ) { $state = 'UNKNOWN'; $answer = "Interface name ($ifName) doesn't match snmp value ($response->{$snmpIfName}) (index $ifIndex)"; } elsif ( not ($response->{$snmpIfAdminStatus} == 1) ) { $state = 'WARNING'; $answer = "Interface $ifName (index $ifIndex) is administratively down."; } elsif ( not ($response->{$snmpIfOperStatus} == 1) ) { $state = 'CRITICAL'; $answer = "Interface $ifName (index $ifIndex) is down."; } else { $state = 'OK'; $answer = "Interface $ifName (index $ifIndex) is up."; } # Get ifAlias if available. @snmpoids = ($snmpIfAlias); $ifDescr = $response->{$snmpIfDescr} if defined $response->{$snmpIfDescr}; if (defined($response = $session->get_request(@snmpoids)) and defined $response->{$snmpIfAlias} and length ($response->{$snmpIfAlias}) > 0) { $answer .= "
ifAlias: $response->{$snmpIfAlias}"; } elsif (defined $ifDescr and length ($ifDescr) > 0) { $answer .= "
ifDescr: $ifDescr"; } $session->close; print ("$state: $answer\n"); exit $ERRORS{$state}; From sghosh at sghosh.org Wed Sep 4 11:21:08 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Wed Sep 4 11:21:08 2002 Subject: [Nagiosplug-devel] network management plugins In-Reply-To: <1031161664.28866.16.camel@guy.fw.belnet.be> Message-ID: Hi Guy Looks like some duplication, some innovation. Is there any difference between the current check_ifoperstatus and check_xinterface? I didn't see any. But the note about include a check for the last state change is a good one. Should be able to roll that into check_ifoperstatus relatively easily. check_cisco_env could probably replace the current contrib of checkciscotemp as it does more... I might even consider rolling the juniper_env and the cisco_env into one plugin - router_env. -sg On 4 Sep 2002, Guy Van Den Bergh wrote: > Hi guys, > > I've written a few plugins useful for network management. They all > written in perl, and using snmp for talking to the routers. They are in > attachment: > > check_xinterface: an 'extended' plugin for monitoring router interfaces > via snmp. It only uses standard mibs for maximum vendor independence. > > check_cisco_env: for monitoring environment of cisco routers > (temperature, power supply, ...) > > check_juniper_env: about the same for juniper routers. > > They perform well in a production environment, but I've had some memory > leaks when using the embedded perl interpreter. So I've switched off the > interpreter :) > > Take a look at it and maybe they are useful for the main plugin > distribution. > > Off course any comments are welcome... > > Best regards, > -- -------------- next part -------------- #!/usr/bin/perl -wT # # check_xinterface - nagios plugin # # largely based upon check_ifoperstatus.pl plugin by Christoph Kron # # # # # Copyright (C) 2002 Guy Van Den Bergh # # 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. # # # Report bugs to: guy at belnet.be # # design of the plugin: # check admin status: if down, then warning; exit # check operational status: if down, then critical; exit # check last change, if within 'tolerance' (-l or --last-change option), # then warning # get performance data: bits in/out, etc... (implementation to be scheduled later) # performance data could be checked against older values (bw drops e.g.) use strict; use Net::SNMP; use Getopt::Long; &Getopt::Long::config('auto_abbrev'); my $status; my $TIMEOUT = 60; my %ERRORS = ('UNKNOWN' , '-1', 'OK' , '0', 'WARNING', '1', 'CRITICAL', '2'); my %ciscoEnvMonState = ('1','normal(1)', '2','warning(2)', '3','critical(3)', '4','shutdown(4)', '5','notPresent(5)', '6','notFunctioning(6)'); my $state = "UNKNOWN"; my $answer = ""; my $snmpkey = 1; my $community = "public"; my $port = 161; my $t_oid; my @snmpoids; my %error_oids; my $snmpCiscoVoltageStatus; my $snmpCiscoTemperatureStatus; my $snmpCiscoFanStatus; my $snmpCiscoSupplyStatus; my $hostname; my $session; my $error; my $response; my $value; my $oid; my @voltage_errors; my @temperature_errors; my @fan_errors; my @supply_errors; sub usage { printf "\nMissing arguments!\n"; printf "\n"; printf "Perl Check Cisco Environment plugin for Nagios\n"; printf "checks status of temperature, fans, ...\n"; printf "usage: \n"; printf "check_cisco_env -c -p "; printf "\nCopyright (C) 2002 Guy Van Den Bergh\n"; printf "check_cisco_env comes with ABSOLUTELY NO WARRANTY\n"; printf "This programm is licensed under the terms of the "; printf "GNU General Public License\n(check source code for details)\n"; printf "\n\n"; exit $ERRORS{"UNKNOWN"}; } # Just in case of problems, let's not hang Nagios $SIG{'ALRM'} = sub { print ("ERROR: No snmp response from $hostname (alarm)\n"); exit $ERRORS{"UNKNOWN"}; }; alarm($TIMEOUT); $status = GetOptions("community=s",\$community, "port=i",\$port); if ($status == 0) { &usage; } #shift; $hostname = shift || &usage; ($session, $error) = Net::SNMP->session( -hostname => $hostname, -community => $community, -port => $port ); if (!defined($session)) { $state='UNKNOWN'; $answer=$error; print ("$state: $answer"); exit $ERRORS{$state}; } $snmpCiscoVoltageStatus = '.1.3.6.1.4.1.9.9.13.1.2.1.7'; $snmpCiscoTemperatureStatus = '.1.3.6.1.4.1.9.9.13.1.3.1.6'; $snmpCiscoFanStatus = '.1.3.6.1.4.1.9.9.13.1.4.1.3'; $snmpCiscoSupplyStatus = '.1.3.6.1.4.1.9.9.13.1.5.1.3'; push(@snmpoids,$snmpCiscoVoltageStatus); push(@snmpoids,$snmpCiscoTemperatureStatus); push(@snmpoids,$snmpCiscoFanStatus); push(@snmpoids,$snmpCiscoSupplyStatus); # # These four oids all have the same syntax, # which makes it easy for scripting all four oids at the same time! # $answer = "No data returned (Environment MIB not supported)"; # This will be overwritten when there IS data returned! TABLE: foreach $t_oid (@snmpoids) { # # Now get all relevant oids, and set the plugin output status accordingly. # if (!defined($response = $session->get_table($t_oid))) { $error_oids{$t_oid} = $session->error; next TABLE; } while ( ($oid, $value) = each %$response ) { if ($value == 1 || $value == 5 || $value == 6) { # normal, notPresent or notFunctioning $state = 'OK' if $state =~ /UNKNOWN/; $answer = "All environment variables normal." if $state eq 'OK'; } elsif ($value == 2) { # warning $error_oids{$oid} = $ciscoEnvMonState{$value}; $state = 'WARNING' unless $state =~ /CRITICAL/; } elsif ($value == 3 || $value == 4) { # critical or shutdown $error_oids{$oid} = $ciscoEnvMonState{$value}; $state = 'CRITICAL' } } } $session->close; ## Here is the place for introducing artificial errors (for debugging). # # Now parse all erroneous responses: # unless ($state eq 'OK' or $state eq 'UNKNOWN') { while ( ($oid, $value) = each %error_oids ) { $value =~ s/\(\d\)//; if ($oid =~ /$snmpCiscoVoltageStatus\./) { $oid =~ s/$snmpCiscoVoltageStatus\.//; push(@voltage_errors, "$value (instance $oid)"); } elsif($oid =~ /$snmpCiscoTemperatureStatus\./) { $oid =~ s/$snmpCiscoTemperatureStatus\.//; push(@temperature_errors, "$value (instance $oid)"); } elsif ($oid =~ /$snmpCiscoFanStatus\./) { $oid =~ s/$snmpCiscoFanStatus\.//; push(@fan_errors, "$value (fan $oid)"); } elsif ($oid =~ /$snmpCiscoSupplyStatus\./) { $oid =~ s/$snmpCiscoSupplyStatus\.//; push(@supply_errors, "$value (PS $oid)"); } } # # And now the final formatting of the output: # my $voltage_errors_s = join ";", @voltage_errors if defined $voltage_errors[0]; my $temperature_errors_s = join ";", @temperature_errors if defined $temperature_errors[0]; my $fan_errors_s = join ";", @fan_errors if defined $fan_errors[0]; my $supply_errors_s = join ";", @supply_errors if defined $supply_errors[0]; $answer = "Problems with:
"; $answer .= "Voltage: " . $voltage_errors_s . "
" if defined $voltage_errors_s; $answer .= "Temperature: " . $temperature_errors_s . "
" if defined $temperature_errors_s; $answer .= "Fans: " . $fan_errors_s . "
" if defined $fan_errors_s; $answer .= "Power Supply: " . $supply_errors_s ."
" if defined $supply_errors_s; } print ("$answer\n"); exit $ERRORS{$state}; -------------- next part -------------- #!/usr/bin/perl -wT # # check_juniper_env - nagios plugin # # largely based upon check_ifoperstatus.pl plugin by Christoph Kron # # # # # Copyright (C) 2002 Guy Van Den Bergh # # 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. # # # Report bugs to: guy at belnet.be # # design of the plugin: # check admin status: if down, then warning; exit # check operational status: if down, then critical; exit # check last change, if within 'tolerance' (-l or --last-change option), # then warning # get performance data: bits in/out, etc... (implementation to be scheduled later) # performance data could be checked against older values (bw drops e.g.) use strict; use Net::SNMP; use Getopt::Long; &Getopt::Long::config('auto_abbrev'); my $status; my $TIMEOUT = 15; my %ERRORS = ('UNKNOWN' , '-1', 'OK' , '0', 'WARNING', '1', 'CRITICAL', '2'); my %jnxOperatingState = ('1','unknown(1)', '2','running(2)', '3','ready(3)', '4','reset(4)', '5','runningAtFullSpeed(5)', '6','down(6)', '7','standby(7)'); my $state = "UNKNOWN"; my $answer = ""; my $snmpkey = 1; my $community = "public"; my $port = 161; my $t_oid; my %error_oids; my $snmpJnxOperatingDescr; my $snmpJnxOperatingState; my $snmpJnxOperatingTemp; my $snmpJnxOperatingCPU; my $hostname; my $session; my $error; my $response; my $temp_w; my $temp_c; my $cpu_w; my $cpu_c; my $value; my $descr; my $oid; my @state_errors; my @temp_errors; my @cpu_errors; sub usage { printf "\nMissing arguments!\n"; printf "\n"; printf "Perl Check Juniper Environment plugin for Nagios\n"; printf "checks status of temperature, fans, ...\n"; printf "usage: \n"; printf "check_juniper_env --community --port --temp --load "; printf "\nCopyright (C) 2002 Guy Van Den Bergh\n"; printf "check_juniper_env comes with ABSOLUTELY NO WARRANTY\n"; printf "This programm is licensed under the terms of the "; printf "GNU General Public License\n(check source code for details)\n"; printf "\n\n"; exit $ERRORS{"UNKNOWN"}; } # Just in case of problems, let's not hang Nagios $SIG{'ALRM'} = sub { print ("ERROR: No snmp response from $hostname (alarm)\n"); exit $ERRORS{"UNKNOWN"}; }; alarm($TIMEOUT); $status = GetOptions("community=s",\$community, "port=i",\$port, "temp=s",\$temp_w, "load=s",\$cpu_w); if ($status == 0) { &usage; } if ($temp_w =~ /\d+:\d+/ and $cpu_w =~ /\d+:\d+/) { ($temp_w, $temp_c) = split /:/, $temp_w; ($cpu_w, $cpu_c) = split /:/, $cpu_w; if ($temp_w > $temp_c) { print "Critical temp is below warning level\n\n"; &usage; } elsif ($cpu_w > $cpu_c) { print "Critical CPU is below warning level\n\n"; &usage; } } else { &usage; } #shift; $hostname = shift || &usage; ($session, $error) = Net::SNMP->session( -hostname => $hostname, -community => $community, -port => $port ); if (!defined($session)) { $state='UNKNOWN'; $answer=$error; print ("$state: $answer"); exit $ERRORS{$state}; } $snmpJnxOperatingDescr = '.1.3.6.1.4.1.2636.3.1.13.1.5'; $snmpJnxOperatingState = '.1.3.6.1.4.1.2636.3.1.13.1.6'; $snmpJnxOperatingTemp = '.1.3.6.1.4.1.2636.3.1.13.1.7'; $snmpJnxOperatingCPU = '.1.3.6.1.4.1.2636.3.1.13.1.8'; $answer = "No data returned (Environment MIB not supported)"; # This will be overwritten when there IS data returned! # # get all jnxOperatingState values (see %jnxOperatingState). # if (!defined($response = $session->get_table($snmpJnxOperatingState))) { $error_oids{$snmpJnxOperatingState} = $session->error; } while ( ($oid, $value) = each %$response ) { if ($value == 1 || $value == 2 || $value == 3 || $value == 7) { # unknown, running, ready or standby $state = 'OK' if $state =~ /UNKNOWN/; $answer = "All environment variables normal." if $state =~ /UNKNOWN/; } elsif ($value == 4 || $value == 5) { # reset or runningAtFullSpeed $error_oids{$oid} = $jnxOperatingState{$value}; $state = 'WARNING' unless $state =~ /CRITICAL/; } elsif ($value == 6) { # down $error_oids{$oid} = $jnxOperatingState{$value}; $state = 'CRITICAL' } } # # get all temperature values # if (!defined($response = $session->get_table($snmpJnxOperatingTemp))) { $error_oids{$snmpJnxOperatingTemp} = $session->error; } while ( ($oid, $value) = each %$response ) { if ($value < $temp_w) { $state = 'OK' if $state =~ /UNKNOWN/; $answer = "All environment variables normal." if $state =~ /UNKNOWN/; } elsif ($value < $temp_c) { $error_oids{$oid} = " $value ?C"; $state = 'WARNING' unless $state =~ /CRITICAL/; } else { $error_oids{$oid} = " $value ?C"; $state = 'CRITICAL' } } # # get all cpu values # if (!defined($response = $session->get_table($snmpJnxOperatingCPU))) { $error_oids{$snmpJnxOperatingCPU} = $session->error; } while ( ($oid, $value) = each %$response ) { if ($value < $cpu_w) { $state = 'OK' if $state =~ /UNKNOWN/; $answer = "All environment variables normal." if $state =~ /UNKNOWN/; } elsif ($value < $cpu_c) { $error_oids{$oid} = " $value%"; $state = 'WARNING' unless $state =~ /CRITICAL/; } else { $error_oids{$oid} = " $value%"; $state = 'CRITICAL' } } ## Here is the place for introducing artificial errors (for debugging). unless ($state eq 'OK' or $state eq 'UNKNOWN') { while ( ($oid, $value) = each %error_oids ) { if ($oid =~ /$snmpJnxOperatingState\./) { $value =~ s/\(\d\)//; $oid =~ s/$snmpJnxOperatingState\.//; if ($response = $session->get_request($snmpJnxOperatingDescr.".$oid")) { $descr = $$response{$snmpJnxOperatingDescr.".$oid"}; } else { $descr = "instance $oid"; } push(@state_errors, "$descr is $value"); } elsif ($oid =~ /$snmpJnxOperatingTemp\./) { $oid =~ s/$snmpJnxOperatingTemp\.//; if ($response = $session->get_request($snmpJnxOperatingDescr.".$oid")) { $descr = $$response{$snmpJnxOperatingDescr.".$oid"}; } else { $descr = "instance $oid"; } push(@temp_errors, " $descr : $value"); } elsif ($oid =~ /$snmpJnxOperatingCPU\./) { $oid =~ s/$snmpJnxOperatingCPU\.//; if ($response = $session->get_request($snmpJnxOperatingDescr.".$oid")) { $descr = $$response{$snmpJnxOperatingDescr.".$oid"}; } else { $descr = "instance $oid"; } push(@cpu_errors, " $descr : $value"); } } my $state_errors_s = join ";", @state_errors if defined $state_errors[0]; my $temp_errors_s = join ";", @temp_errors if defined $temp_errors[0]; my $cpu_errors_s = join ";", @cpu_errors if defined $cpu_errors[0]; $answer = "Problems with:
"; $answer .= "State: " . $state_errors_s . "
" if defined $state_errors_s; $answer .= "Temperature: " . $temp_errors_s . "
" if defined $temp_errors_s; $answer .= "CPU: " . $cpu_errors_s . "
" if defined $cpu_errors_s; $session->close; } print ("$answer\n"); exit $ERRORS{$state}; -------------- next part -------------- #!/usr/bin/perl -wT # # check_xinterface - nagios plugin # # largely based upon check_ifoperstatus.pl plugin by Christoph Kron # # # # # Copyright (C) 2002 Guy Van Den Bergh # # 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. # # # Report bugs to: guy at belnet.be # # design of the plugin: # get index for interface from -i option (format: ::) # check whether ifName matches ifIndex: if not: warning; exit # check admin status: if down, then warning; exit # check operational status: if down, then critical; exit # check last change, if within 'tolerance' (-l or --last-change option), # then warning # get performance data: bits in/out, etc... (implementation to be scheduled later) # performance data could be checked against older values (bw drops e.g.) use strict; use Net::SNMP; use Getopt::Long; &Getopt::Long::config('auto_abbrev'); my @cmdline = @ARGV; my $status; my $TIMEOUT = 15; my %ERRORS = ('OK' , '0', 'WARNING', '1', 'CRITICAL', '2', 'UNKNOWN', '3'); my %ifOperStatus = ('1','up', '2','down', '3','testing', '4','unknown', '5','dormant', '6','notPresent'); my $state = "UNKNOWN"; my $answer = "(No output. Bug?)"; my $ifName; my $ifIndex; my $ifDescr; my $community = "public"; my $port = 161; my @snmpoids; my $snmpIfName; my $snmpIfDescr; my $snmpIfAlias; my $snmpIfAdminStatus; my $snmpIfOperStatus; my $hostname; my $session; my $error; my $response; sub usage { printf "\nMissing arguments!\n"; printf "\n"; printf "Perl eXtended Check Interface plugin for Nagios\n"; printf "checks status of specified interface\n"; printf "When the interface state changed within the last check interval, a WARNING is returned. \n\n"; printf "usage: \n"; printf "check_xinterface -i -n -c -p \n"; printf "\nCopyright (C) 2002 Guy Van Den Bergh\n"; printf "check_xinterface comes with ABSOLUTELY NO WARRANTY\n"; printf "This programm is licensed under the terms of the "; printf "GNU General Public License\n(check source code for details)\n"; printf "\n\n"; exit $ERRORS{"UNKNOWN"}; } # Just in case of problems, let's not hang Nagios $SIG{'ALRM'} = sub { print ("ERROR: No snmp response from $hostname (alarm)\n"); exit $ERRORS{"UNKNOWN"}; }; alarm($TIMEOUT); $status = GetOptions("index=s",\$ifIndex, "name=s",\$ifName, "community=s",\$community, "port:i",\$port); if ($status == 0) { &usage; } if (not defined $ifIndex) { print ("ERROR: No snmp ifIndex supplied (@cmdline)\n"); exit $ERRORS{"UNKNOWN"}; } if (not defined $ifName) { print ("ERROR: No snmp ifName supplied (@cmdline)\n"); exit $ERRORS{"UNKNOWN"}; } $hostname = shift || &usage; ($session, $error) = Net::SNMP->session( -hostname => $hostname, -community => $community, -port => $port ); if (!defined($session)) { $state='UNKNOWN'; $answer=$error; print ("$state: $answer"); exit $ERRORS{$state}; } $snmpIfAdminStatus = '.1.3.6.1.2.1.2.2.1.7.' . $ifIndex; $snmpIfOperStatus = '.1.3.6.1.2.1.2.2.1.8.' . $ifIndex; $snmpIfName = '.1.3.6.1.2.1.31.1.1.1.1.' . $ifIndex; $snmpIfDescr = '.1.3.6.1.2.1.2.2.1.2.' . $ifIndex; $snmpIfAlias = '.1.3.6.1.2.1.31.1.1.1.18.' . $ifIndex; push(@snmpoids,$snmpIfName); push(@snmpoids,$snmpIfDescr); push(@snmpoids,$snmpIfAdminStatus); push(@snmpoids,$snmpIfOperStatus); if (!defined($response = $session->get_request(@snmpoids))) { $answer=$session->error; $session->close; $state = 'WARNING'; print ("$state: SNMP error: $answer\n"); exit $ERRORS{$state}; } if ( not ($response->{$snmpIfName} eq $ifName) ) { $state = 'UNKNOWN'; $answer = "Interface name ($ifName) doesn't match snmp value ($response->{$snmpIfName}) (index $ifIndex)"; } elsif ( not ($response->{$snmpIfAdminStatus} == 1) ) { $state = 'WARNING'; $answer = "Interface $ifName (index $ifIndex) is administratively down."; } elsif ( not ($response->{$snmpIfOperStatus} == 1) ) { $state = 'CRITICAL'; $answer = "Interface $ifName (index $ifIndex) is down."; } else { $state = 'OK'; $answer = "Interface $ifName (index $ifIndex) is up."; } # Get ifAlias if available. @snmpoids = ($snmpIfAlias); $ifDescr = $response->{$snmpIfDescr} if defined $response->{$snmpIfDescr}; if (defined($response = $session->get_request(@snmpoids)) and defined $response->{$snmpIfAlias} and length ($response->{$snmpIfAlias}) > 0) { $answer .= "
ifAlias: $response->{$snmpIfAlias}"; } elsif (defined $ifDescr and length ($ifDescr) > 0) { $answer .= "
ifDescr: $ifDescr"; } $session->close; print ("$state: $answer\n"); exit $ERRORS{$state}; From Daniel.Rusch at GlobalCrossing.com Thu Sep 5 13:34:02 2002 From: Daniel.Rusch at GlobalCrossing.com (Rusch, Daniel) Date: Thu Sep 5 13:34:02 2002 Subject: [Nagiosplug-devel] Trivial Bug, check_rpc Message-ID: <0DA06E553C3BD511823500508BB8965A020120CF@exnadetmbx3.ams.gblxint.com> Trivial bug, The exit value for the $opt_V currently is 'Ok' it should be 'OK' (capital K) It complains when it exists. Sincerely, Daniel G. Rusch From mattp at esec.com.au Thu Sep 5 18:13:03 2002 From: mattp at esec.com.au (Matthew Peters) Date: Thu Sep 5 18:13:03 2002 Subject: [Nagiosplug-devel] BugFix of check_log Message-ID: <1031274540.27239.3.camel@dhcp4.net2.esec.com.au> Hiya, I recently (today) had a use for the check_log plugin, but found that it contained a few bugs. I fixed these, and cleaned up some of the exit codes while I was at it. Hope it helps someone. -Matt -------------- next part -------------- 169c169 < exit 2 --- > exit $STATE_UNKNOWN 179c179 < exit 0 --- > exit $STATE_OK 187c187 < tempdiff="/bin/mktemp /tmp/check_log.XXXXXXXXXX" --- > tempdiff='/bin/mktemp /tmp/check_log.XXXXXXXXXX' 190c190 < /bin/touch $tempdiff --- > /bin/touch $tempdiff 207c207 < exitstatus=0 --- > exitstatus=$STATE_OK 209a210 > exitstatus=$STATE_CRITICAL 212c213 < exit exitstatus --- > exit $exitstatus From karl at debisschop.net Thu Sep 5 19:27:01 2002 From: karl at debisschop.net (Karl DeBisschop) Date: Thu Sep 5 19:27:01 2002 Subject: [Nagiosplug-devel] Trivial Bug, check_rpc In-Reply-To: <0DA06E553C3BD511823500508BB8965A020120CF@exnadetmbx3.ams.gblxint.com> References: <0DA06E553C3BD511823500508BB8965A020120CF@exnadetmbx3.ams.gblxint.com> Message-ID: <1031279175.1517.7.camel@miles.debisschop.net> On Thu, 2002-09-05 at 16:31, Rusch, Daniel wrote: > Trivial bug, > > The exit value for the $opt_V currently is 'Ok' it should be 'OK' (capital > K) > > It complains when it exists. > > Sincerely, > > Daniel G. Rusch Thanks. Patch applied to CVS tree. -- Karl From aderuwe at aqs-carcontrol.be Mon Sep 9 06:42:14 2002 From: aderuwe at aqs-carcontrol.be (Alexander Deruwe) Date: Mon Sep 9 06:42:14 2002 Subject: [Nagiosplug-devel] 'make all' problem Message-ID: <20020909133931.GJ5098@nbalexander.aqs-carcontrol.be> When running 'make all' (after a succesful ./configure) results in the following error: aderuwe at faxmaster:~/nagiosplug-1.3-beta1$ make all cd . && /bin/sh: -c: line 2: syntax error: unexpected end of file make: *** [aclocal.m4] Error 2 This is on Debian GNU/Linux unstable (kernel version 2.4.16) GNU bash, version 2.05a.0(1)-release-(i386-pc-linux-gnu) Machine architecture is x86. Thanks! PS: I do not subscribe to this list, so if you could CC me on replies I would be grateful. -- Alexander Deruwe AQS-CarControl From phil at bolthole.com Mon Sep 9 16:23:02 2002 From: phil at bolthole.com (Philip Brown) Date: Mon Sep 9 16:23:02 2002 Subject: [Nagiosplug-devel] improved check_oracle Message-ID: <20020909162137.A93132@bolthole.com> Improved version of check_oracle attached. Allows actually logging in as a user, and doing select * from dual; which is a lot more definitive in saying "oracle is working", than either checking the listener, or seeing if the oracle process is running. new added syntax: check_oracle --oralogin user/pw at ora.name -------------- next part -------------- #! /bin/sh # # made by latigid010 at yahoo.com # 01/06/2000 # # This Nagios plugin was created to check remote or local TNS # status and check local Database status. # # Updated by Philip Brown to allow doing a login with # specified oracle loginstring, and do "select * from dual;" # # Sample configuration to add to checkcommands.cfg: # command[check-oracle-tns]=/usr/local/nagios/libexec/check_oracle --tns $ARG$ # command[check-oracle-ps]=/usr/local/nagios/libexec/check_oracle --db $ARG$ # command[check-oracle-login]=/usr/local/nagios/libexec/check_oracle --oralogin $ARG$ # # # Usage: # (See print_usage() function) # # I have the script checking for the Oracle PMON process and # the sgadefORACLE_SID.dbf file. # # # If you have any problems check that you have the $ORACLE_HOME # enviroment variable set. # The script will adjust its PATH and LD_LIBRARY_PATH based on that. # Dont forget about your tnsnames.ora file. # When checking Local Database status your ORACLE_SID is case sensitive. # # You may want to hardcode this here, so that your oracle client # binaries will work. Otherwise, set in nagios's profile or something. # #export ORACLE_HOME PATH LD_LIBRARY_PATH #ORACLE_HOME=/opt/oracle/product/8.1.7.3 PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` REVISION=`echo '$Revision: 1.2 $' | sed -e 's/[^0-9.]//g'` . $PROGPATH/utils.sh print_usage() { echo "Usage:" echo " $PROGNAME --tns " echo " $PROGNAME --db " echo " $PROGNAME --oranames " echo " $PROGNAME --oralogin " echo " $PROGNAME --help" echo " $PROGNAME --version" } print_help() { print_revision $PROGNAME $REVISION echo "" print_usage echo "" echo "Check remote or local TNS status and check local Database status" echo "" echo "--tns=SID/IP Address" echo " Check remote TNS server" echo "--db=SID" echo " Check local database (search /bin/ps for PMON process and check" echo " filesystem for sgadefORACLE_SID.dbf" echo "--oranames=Hostname" echo " Check remote Oracle Names server" echo "--oralogin=user/pw at oracle_db.name" echo " Try basic user login to oracle" echo "--help" echo " Print this help screen" echo "--version" echo " Print version and license information" echo "" echo "If the plugin doesn't work, check that the ORACLE_HOME environment" echo "variable is set, that ORACLE_HOME/bin is in your PATH, and the" echo "tnsnames.ora file is locatable and is properly configured." echo "" echo "When checking Local Database status your ORACLE_SID is case sensitive." echo "" support } check_login() { sqlplus $1 << EOF select * from dual; quit; EOF } case "$1" in 1) cmd='--tns' ;; 2) cmd='--db' ;; 3) cmd='--oralogin' ;; *) cmd="$1" ;; esac # Hunt down a reasonable ORACLE_HOME if [ -z "$ORACLE_HOME" ] ; then # Adjust to taste for oratab in /var/opt/oracle/oratab /etc/oratab do [ ! -f $oratab ] && continue ORACLE_HOME=`IFS=: while read SID ORACLE_HOME junk; do if [ "$SID" = "$2" ] ; then echo $ORACLE_HOME; exit; fi; done < $oratab` [ -n "$ORACLE_HOME" ] && break done fi # Last resort [ -z "$ORACLE_HOME" -a -d $PROGPATH/oracle ] && ORACLE_HOME=$PROGPATH/oracle if [ -z "$ORACLE_HOME" -o ! -d "$ORACLE_HOME" ] ; then echo "Cannot determine ORACLE_HOME for sid $2" exit $STATE_UNKNOWN fi PATH=$PATH:$ORACLE_HOME/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib export ORACLE_HOME PATH LD_LIBRARY_PATH case "$cmd" in --tns) tnschk=` tnsping $2` tnschk2=` echo $tnschk | grep -c OK` if [ ${tnschk2} -eq 1 ] ; then tnschk3=` echo $tnschk | sed -e 's/.*(//' -e 's/).*//'` echo "OK - reply time ${tnschk3} from $2" exit $STATE_OK else echo "No TNS Listener on $2" exit $STATE_CRITICAL fi ;; --oralogin) # we COULD do a somewhat more stringent check of output, but I think # this should be "good enough" ? check_login $2 | grep ERROR >/dev/null if [ $? -eq 0 ] ; then # we saw "ERROR" echo "Error doing select from dual. Check login to database manually" exit $STATE_CRITICAL fi echo "OK - select statement succeeded" exit $STATE_OK EOF tnschk=` tnsping $2` tnschk2=` echo $tnschk | grep -c OK` if [ ${tnschk2} -eq 1 ] ; then tnschk3=` echo $tnschk | sed -e 's/.*(//' -e 's/).*//'` echo "OK - reply time ${tnschk3} from $2" exit $STATE_OK else echo "No TNS Listener on $2" exit $STATE_CRITICAL fi ;; --oranames) namesctl status $2 | awk ' /Server has been running for:/ { msg = "OK: Up" for (i = 6; i <= NF; i++) { msg = msg " " $i } status = '$STATE_OK' } /error/ { msg = "CRITICAL: " $0 status = '$STATE_CRITICAL' } END { print msg exit status }' ;; --db) pmonchk=`ps -ef | grep -v grep | grep ${2} | grep -c pmon` if [ ${pmonchk} -ge 1 ] ; then echo "${2} OK - ${pmonchk} PMON process(es) running" exit $STATE_OK #if [ -f $ORACLE_HOME/dbs/sga*${2}* ] ; then #if [ ${pmonchk} -eq 1 ] ; then #utime=`ls -la $ORACLE_HOME/dbs/sga*$2* | cut -c 43-55` #echo "${2} OK - running since ${utime}" #exit $STATE_OK #fi else echo "${2} Database is DOWN" exit $STATE_CRITICAL fi ;; --help) print_help exit $STATE_OK ;; -h) print_help exit $STATE_OK ;; --version) print_revision $PLUGIN $REVISION exit $STATE_OK ;; -V) print_revision $PLUGIN $REVISION exit $STATE_OK ;; *) print_usage exit $STATE_UNKNOWN esac From jmarquart at planalytics.com Tue Sep 10 05:40:03 2002 From: jmarquart at planalytics.com (jmarquart at planalytics.com) Date: Tue Sep 10 05:40:03 2002 Subject: [Nagiosplug-devel] improved check_oracle Message-ID: <85256C30.00455E2E.00@mailhost.planalytics.com> Philip, I don't know if you would be interested, but I submitted some patches over the summer that also enables you to use the check_oracle script to check the current capacities of tablespaces. It returns a percentage utilized as well as number of MB / Total MB available. I am sure in the list archives there is a copy - or I would be happy to send you one if interested. -john Philip Brown on 09/09/2002 07:21:37 PM Please respond to Philip Brown To: nagiosplug-devel at lists.sourceforge.net cc: (bcc: John J. der Schalla Marquart/Planalytics) Subject: [Nagiosplug-devel] improved check_oracle Improved version of check_oracle attached. Allows actually logging in as a user, and doing select * from dual; which is a lot more definitive in saying "oracle is working", than either checking the listener, or seeing if the oracle process is running. new added syntax: check_oracle --oralogin user/pw at ora.name -------------- next part -------------- A non-text attachment was scrubbed... Name: check_oracle Type: application/octet-stream Size: 5843 bytes Desc: not available URL: From g.vdb at pandora.be Wed Sep 11 07:53:02 2002 From: g.vdb at pandora.be (Guy Van Den Bergh) Date: Wed Sep 11 07:53:02 2002 Subject: [Nagiosplug-devel] more info on network management plugins Message-ID: <1031755915.635.104.camel@guy.fw.belnet.be> Hi there, It took a while, but here is some more info on the network management plugins I submitted to the list about a week ago. 1. What has check_xinterface to offer over check_ifoperstatus.pl? (I have developed check_xinterface because check_ifoperstatus didn't really do what I wanted.) *) check_xinterface considers also the administrative status of the interface: when the interface is admin down, only a WARNING status is returned (CRITICAL when admin up & operational down). *) check_xinterface needs the ifIndex as well as the ifName as input options. This offers a method to detect when interface indices have changed, e.g. after a reboot (recent Cisco IOS versions support ifIndex persistence, but this is not always available; I do not know what a Juniper router does with the indices after a reboot). *) check_xinterface returns UNKNOWN when the snmp poll fails (check_ifoperstatus returns critical). SNMP implementations on commercial routers are pretty stable. Most of the time an SNMP poll failure means the router is down, and this is detected with the check-host-alive command. 2. The router environment plugins. It is indeed a good idea to fold both check_cisco_env and check_juniper_env into a single plugin, but I will need some more time to implement this. This way it should be easily extensible with other proprietary environment MIBs (Foundry, Unisphere, Alcatel, ...) From sghosh at sghosh.org Wed Sep 11 12:04:58 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Wed Sep 11 12:04:58 2002 Subject: [Nagiosplug-devel] more info on network management plugins In-Reply-To: <1031755915.635.104.camel@guy.fw.belnet.be> Message-ID: Sorry - don't mean to be nit-picking... ;) On 11 Sep 2002, Guy Van Den Bergh wrote: > Hi there, > > It took a while, but here is some more info on the network management > plugins I submitted to the list about a week ago. > > 1. What has check_xinterface to offer over check_ifoperstatus.pl? > (I have developed check_xinterface because check_ifoperstatus didn't > really do what I wanted.) > > *) check_xinterface considers also the administrative status of the > interface: when the interface is admin down, only a WARNING status is > returned (CRITICAL when admin up & operational down). Is this logical? - often we have interfaces installed on devices that are not in use and therefore admin down. If monitoring a specific interface (therefore assumption is that it should be up), why would the interface go admin down - (if maintenance then scheduling downtime ...) Inadvertent change of admin to down should get flagged on your configuration diffs (You are doing those, right :) > > *) check_xinterface needs the ifIndex as well as the ifName as input > options. This offers a method to detect when interface indices have > changed, e.g. after a reboot (recent Cisco IOS versions support ifIndex > persistence, but this is not always available; I do not know what a > Juniper router does with the indices after a reboot). By requiring both ifIndex and ifName in the config file you are forcing a nms reconfig because of a router reboot with snmp reindexing. Seems to me to be at cross-purposes in trying to maintain nms uptime. The current version of check_ifoperstatus supports either ifIndex or ifDescr for the interface. It could be improved to use ifName instead of ifDescr if the -I (support for ifXTable) is provided. > > *) check_xinterface returns UNKNOWN when the snmp poll fails > (check_ifoperstatus returns critical). SNMP implementations on > commercial routers are pretty stable. Most of the time an SNMP poll > failure means the router is down, and this is detected with the > check-host-alive command. True - but having a critical here allows for faster notification rather than waiting for the host-check max-attempts to expire. > > 2. The router environment plugins. > It is indeed a good idea to fold both check_cisco_env and > check_juniper_env into a single plugin, but I will need some more time > to implement this. This way it should be easily extensible with other > proprietary environment MIBs (Foundry, Unisphere, Alcatel, ...) > I can give you a hand on this, if you'd like. -- -sg From g.vdb at pandora.be Thu Sep 12 03:42:02 2002 From: g.vdb at pandora.be (Guy Van Den Bergh) Date: Thu Sep 12 03:42:02 2002 Subject: [Nagiosplug-devel] more info on network management plugins In-Reply-To: References: Message-ID: <1031827264.9670.107.camel@guy.fw.belnet.be> On Wed, 2002-09-11 at 21:03, Subhendu Ghosh wrote: > Sorry - don't mean to be nit-picking... > Don't worry, discussion is good :) > > > > *) check_xinterface considers also the administrative status of the > > interface: when the interface is admin down, only a WARNING status is > > returned (CRITICAL when admin up & operational down). > > Is this logical? - often we have interfaces installed on devices that are > not in use and therefore admin down. If monitoring a specific interface > (therefore assumption is that it should be up), why would the interface go > admin down - (if maintenance then scheduling downtime ...) > > Inadvertent change of admin to down should get flagged on your > configuration diffs (You are doing those, right :) You have a point, but anyway you can choose in the nagios config whether you want a notification on admin down or not. If an interface is admin down, it is (probably) done through manual intervention, maybe even for a good reason. I still think it is good to treat admin down and operational down differently. > > By requiring both ifIndex and ifName in the config file you are forcing a > nms reconfig because of a router reboot with snmp reindexing. Seems to me > to be at cross-purposes in trying to maintain nms uptime. That's true, but I tried to find a balance between nms uptime, snmp traffic and monitoring the correct interface (read on!). > > The current version of check_ifoperstatus supports either ifIndex or > ifDescr for the interface. It could be improved to use ifName instead of > ifDescr if the -I (support for ifXTable) is provided. > It is indeed possible to provide only ifName or ifDescr, and get the correct index from the router with snmp. But I think this might be a problem on routers with a large number of interfaces. Excessive traffic can be solved by storing a mapping ifName->ifIndex locally and let the plugin use this data when available. But I'm not sure whether this is a good idea for plugin performance. Any ideas? Another possibility is to get the index when only ifName or ifDescr is provided, use the index directly when provided, and ultimately make the comparison as I am doing now when both are provided. > > *) check_xinterface returns UNKNOWN when the snmp poll fails > > (check_ifoperstatus returns critical). SNMP implementations on > > commercial routers are pretty stable. Most of the time an SNMP poll > > failure means the router is down, and this is detected with the > > check-host-alive command. > > True - but having a critical here allows for faster notification rather > than waiting for the host-check max-attempts to expire. I'd rather wait for that to be really sure the host is down. You can have a condition where a link is lost, which makes a router unreachable. I will receive 2 notifications: host down and interface down (on the router still reachable). You will get at least 3 notifications with ifoperstatus.pl (one interface down and at least one unreachable and one host down). xinterface can return all states: unknown, ok, warning and critical; ifoperstatus only returns ok and critical, and unknown on a condition which will not be met very often (plugin timeout instead of snmp session timeout). > > 2. The router environment plugins. > > It is indeed a good idea to fold both check_cisco_env and > > check_juniper_env into a single plugin, but I will need some more time > > to implement this. This way it should be easily extensible with other > > proprietary environment MIBs (Foundry, Unisphere, Alcatel, ...) > > > I can give you a hand on this, if you'd like. > Welcome aboard ;) I was thinking of transforming the two plugins into functions, and make the check_router_env decide whether it should call the cisco_env function or the juniper_env function. Any suggestions? Many greetings, Guy From reply at seekercenter.net Fri Sep 13 01:19:03 2002 From: reply at seekercenter.net (Vanessa Lintner) Date: Fri Sep 13 01:19:03 2002 Subject: [Nagiosplug-devel] I have visited NAGIOSPLUG.SOURCEFORGE.NET and noticed that ... Message-ID: An HTML attachment was scrubbed... URL: From uwe.zietzling at baw.de Fri Sep 13 08:36:02 2002 From: uwe.zietzling at baw.de (Zietzling, Uwe) Date: Fri Sep 13 08:36:02 2002 Subject: [Nagiosplug-devel] Wrote a new snmp based plugin Message-ID: Hello! I wrote two plugins for monitoring disk usage. One for unix computers. And one for windows2000 computers. With these plugins you dont need to have an addon running on the server you'd like to monitor. The only thing you have to do on your "Nagios Client" is to configure your snmp. The plugin is completely written in unix shell script (bash) and awk. It uses the snmpdf program of the net-snmp package. So make shure your Nagios Server has the snmpdf command( IMPORTANT: use the ucd-snmp version 4.2.5 or higher. The snmpdf of a lower version does not work reliable!). You can monitor every mountpoint you can see with the local df -k command. There is an extra check_w2kdisk script because of a different output of snmpdf from w2k computers( a dammed HD serial number). Before you use the plugins it's adviceable to try the snmpdf command on your command line, in order to see if it can get a propper response at all. The check_unixdisk is proved to work with SuSELinux 7.0 - 8.0. It does not work with "Nagios Clients" running HP-UX 11.x. The script creates a /tmp/nagios directory with needed files( keep in mind: if you start the script the very first time by hand( maybe a test as root) you have to change the User- and Group name of the /tmp/nagios/* to whatever your nagios is running with. Otherwise the access to this files will be denied once the nagios starts the check_unixdisk or the check_w2kdisk script.). I hope i mentioned everything important. Have fun with it, work on it and let me know about importand and helpful changes. I would be interested in the C code of this program. So long..... Uwe P.S: hope you can read and understand my more or less bad english :-) <> <> -------------- next part -------------- A non-text attachment was scrubbed... Name: check_unixdisk Type: application/octet-stream Size: 3084 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: check_w2kdisk Type: application/octet-stream Size: 3207 bytes Desc: not available URL: From karl at debisschop.net Sat Sep 14 04:51:02 2002 From: karl at debisschop.net (Karl DeBisschop) Date: Sat Sep 14 04:51:02 2002 Subject: [Nagiosplug-devel] RE: [Nagios-users] performance data from plugins - does it exist? In-Reply-To: References: Message-ID: <1032004202.18622.30.camel@miles.debisschop.net> On Fri, 2002-09-13 at 23:59, Jeremy Tinley wrote: > On 9/13/02 9:23 PM, Karl DeBisschop (karl at debisschop.net) said: > > >These are not currently tracked separately. The could be, but I'd like > >to get basic performance stuff in, do some bug squashing, and make a > >formal release. It just doesn't make sense to delay a formal release for > >these (IMHO). > > Hmm, it wasn't terribly tough to do. In the check_disk.c, I return 2 > variables, percentage used and kb free. Just modify the printf line. I > finished about 4 modifications today (plus some of my custom scripts) so > I could get some sample data from the weekend. Ping, Disk, HTTP and Swap. Nobody at all said it was tough. I just said there were infants with diapers needing to be changed, jobs with project deadlines, houses that need to be sold, NT servers with catastrophic disc failures, relatives getting married.... It simply isn't the only thing on my plate. I suspect the same is true for most of us. As for your patches, I'd be gald to have them posted to the list (nagiosplug-devel). People can comment on them, and they can get added to CVS. > Maybe you can help me with saving my diff as a patch, or commiting to CVS. Forgive my bluntness, but if I need to teach you haw to make a patch, then I'm certainly not going to authorize you to commit directly to CVS. Nor does your posting to me alone instead of the plugin development list suggest a great commitment to working with the group, another prerequisite for CVS access. As for how to make a patch, I refer you to http://nagiosplug.sourceforge.net/developer-guidelines.html#SUBMITTINGCHANGES with the additional comment that a patch is simply the output of diff. I prefer unified diffs. I think the following works: cvs diff -U 4 Makefile.am | tail +5 Ah but now I've spent 20 minutes time looking this up, which means I will basically not have time to work on actual coding or looking at patches :-( > >To start with, let's say "time" is one. Units will be defined to be > >seconds. > > > >I have taken a quick stab at logging time for check_http. > > > >Turns out it's not quite as clear as one might think. If the plugin > >returns an CRITICAL state because a desired string is not found, should > >a time be logged? Probably depends on the user. There's at least a few > >judgement calls like that. I assume errors on 404s should not be logged, > >generally, but that again may depend on the application. > > > >But I took a crack at it, and I'll commit it for comment. > > > In this example, I would return response time of null and a status code > of 404 (or whatever HTTP status code was returned. Does everyone else agree? Are all handlers able to accept a response time of null? I assume that would be 'time='. IIRC, that is not in the syntax, so I'm not even sure nagios will like it. > Part of the information that gets logged is the state (OK, CRIT, WARN, > UNKNOWN). I suppose you could log EVERYTHING to a database that is > returned from the plugin... but that seemed a bit overkill to me. So state (returned by the plugin) is another standard variable? Probably 'status', like '404' should also be. Should 'state be the number or the word? > My database consists of host, timestamp, Nagios description, State, > variable and metric with a key off of host,timestamp,description and > variable. The PHP code takes a host, description and variable as the > query, and optionally a timestamp. > > Getting back to the task at hand, the code should be sufficiently > modified to include what each possible variable returned and it's > correponding unit in the --help/-h screen. Above you said the task was trivial -- just modify the printf line. But now we also need to modify the help page. And there's 38 plugins in C alone, and many plugins have more than one printf line, and many have interesting variables that are not currently tracked - like the dns reslottion time that one user requested for check_http. I've now spent a full half hour just on this letter. Is it now becoming clear how going into too much detail could distract from other things that are essential for a true release. I do feel that performance data should be part of the formal 1.3.0 release, although it's never been discussed to my knowlege. I just don't want to spend time logging performance data for every concievable variable on this pass, especailly if it requires tracking new timers and varibles for them, and other ancillary coding. I'd rather focus on getting a formal release that includes an acceptable level of detail done in a way that the most (all?) users and developers feel makes sense. -- Karl > -J > From atonns at mail.ivillage.com Mon Sep 16 07:42:03 2002 From: atonns at mail.ivillage.com (atonns at mail.ivillage.com) Date: Mon Sep 16 07:42:03 2002 Subject: [Nagiosplug-devel] SNMP authentication for plugins Message-ID: I'm in the process of writing a few plugins in perl that use Net::SNMP to monitor certain elements of the net-snmpd host resources mib and possibly some custom scripted mibs. One thing I've noticed is that all the snmp-related scripts use SNMP v1 or v2c for getting data from the clients - which is why I am re-writing them. I want to use SNMP v3, especially using the 'snmpkey' script that comes with the Net::SNMP perl module. (FYI: I can't get SNMP::Session to compile on Solaris 9) With SNMP v3, it's not very wise to put authpassword and privpassword data on the command line of a check script. Right now I have my authentication info embedded in the script. However, if I plan to share my scripts with the community, there has to be a simpler method for authentication - no 'end-user' (including myself) wants to edit every check script for authentication. I propose one of two solutions: Easy - create an snmpauth.pm module to put in the libexec dir. It contains only simple constructor that creates a Net::SNMP->session object with the authentication info embedded in it. I will only be used by modules that need it. Hard - modify utils.pm to include a similar constructor, but reads authentication info from some config file. Obviously if Net::SNMP isn't present this sub shouldn't cause the utils module to barf. However, the whole reason I'm posting this to the list is to solicit opinions or hear other people's solutions (including ones I might have missed already included in docs / plugins). P.S. I'm using the netsaint 1.2.9-4 plugins because I couldn't get the autoconf/autoheader/automake/configure/make thing working on Solaris 9 with Sun's SFW crap. However, I have been reading the documentation and source for the 1.3-beta1 plugins for tips and coding conventions. -- "Computer science is as much about computers as astronomy is about telescopes" -- Edsger Dijkstra --------------------------------------------------------- Anthony Tonns, UNIX Administrator - atonns at mail.ivillage.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tom.Bertelson at gecapital.com Mon Sep 16 07:50:08 2002 From: Tom.Bertelson at gecapital.com (Bertelson, Tom (CAP, CARD)) Date: Mon Sep 16 07:50:08 2002 Subject: [Nagiosplug-devel] SNMP authentication for plugins Message-ID: <41BE560FEB5CD411AB0100D0B784C039046BF164@exc004gptccsge.cfs.capital.ge.com> How about putting the info in the resources.cfg file, and parse it from there? That's the place for passwords, and the plugin should be running with the correct permissions to read this file. The format is simple enough, you probably don't need to create a special module (but it wouldn't hurt; put it into Utils.pm). -- Tom Bertelson "Any sufficiently advanced technology GE Card Services is indistinguishable from magic." -- Arthur C. Clarke -----Original Message----- From: atonns at mail.ivillage.com [mailto:atonns at mail.ivillage.com] Sent: Monday, September 16, 2002 10:42 AM To: nagiosplug-devel at lists.sourceforge.net Subject: [Nagiosplug-devel] SNMP authentication for plugins I'm in the process of writing a few plugins in perl that use Net::SNMP to monitor certain elements of the net-snmpd host resources mib and possibly some custom scripted mibs. One thing I've noticed is that all the snmp-related scripts use SNMP v1 or v2c for getting data from the clients - which is why I am re-writing them. I want to use SNMP v3, especially using the 'snmpkey' script that comes with the Net::SNMP perl module. (FYI: I can't get SNMP::Session to compile on Solaris 9) With SNMP v3, it's not very wise to put authpassword and privpassword data on the command line of a check script. Right now I have my authentication info embedded in the script. However, if I plan to share my scripts with the community, there has to be a simpler method for authentication - no 'end-user' (including myself) wants to edit every check script for authentication. I propose one of two solutions: Easy - create an snmpauth.pm module to put in the libexec dir. It contains only simple constructor that creates a Net::SNMP->session object with the authentication info embedded in it. I will only be used by modules that need it. Hard - modify utils.pm to include a similar constructor, but reads authentication info from some config file. Obviously if Net::SNMP isn't present this sub shouldn't cause the utils module to barf. However, the whole reason I'm posting this to the list is to solicit opinions or hear other people's solutions (including ones I might have missed already included in docs / plugins). P.S. I'm using the netsaint 1.2.9-4 plugins because I couldn't get the autoconf/autoheader/automake/configure/make thing working on Solaris 9 with Sun's SFW crap. However, I have been reading the documentation and source for the 1.3-beta1 plugins for tips and coding conventions. -- "Computer science is as much about computers as astronomy is about telescopes" -- Edsger Dijkstra --------------------------------------------------------- Anthony Tonns, UNIX Administrator - atonns at mail.ivillage.com From Martin.Schmitz at naw.de Thu Sep 19 00:50:05 2002 From: Martin.Schmitz at naw.de (Martin.Schmitz at naw.de) Date: Thu Sep 19 00:50:05 2002 Subject: [Nagiosplug-devel] inconsistance between nagios and documentation Message-ID: hi, as i stated earlier in this list, there is an inconsistance between nagios and the documentation and even between different parts of the documentation. unfortunately this has not been fixed in the latest beta. just compare the description of freshness_threshold in "xodtemplate.html", "distributed.html" and "freshness.html". the description in "xodtemplate.html" matches the behavior of nagios. i think this should be fixed. martin >Hi, > >first, there is an inconsistant description of freshness checks in the >documentation. >the freshness_threshold must be given in seconds, but the freshness.html >says: if set to 5 and interval_length is set to 60 then it will be 5 >minutes. this isn't true. see paragraph "How The Freshness Threshold Works" >the same wrong description is given on the page distributed.html paragraph >"Freshness Checking". > >second: >I'm providing some passive service checks to nagios without using nsca. the >check time is provided by the remote host. the check is executed every 5 >minutes and freshness_threshold is set to 10 minutes. the problem is, that >the remote hosts time isn't synchronized with the nagios hosts time. if the >remote hosts time is more then 10 minutes after the nagios time, then the >service states will flap all the time, because each incoming passive >service check result is detected to be stale. this could be solved by >synchronizing the times with NTP, but which way should be used if NTP isn't >possible. How does NSCA handle this? >As a workaround i do not use the check time from the remote host, but >replace it with the local time when passing the result into the external >command file. any suggestions about a better solution? > >martin ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 _______________________________________________ Nagiosplug-devel mailing list Nagiosplug-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagiosplug-develMartin Schmitz net&works From sghosh at sghosh.org Sun Sep 22 18:01:01 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Sun Sep 22 18:01:01 2002 Subject: [Nagiosplug-devel] Re: [Nagiosplug-checkins] CVS: nagiosplug INSTALL,1.4,1.5 In-Reply-To: Message-ID: On Sun, 15 Sep 2002, Karl DeBisschop wrote: > Update of /cvsroot/nagiosplug/nagiosplug > In directory usw-pr-cvs1:/tmp/cvs-serv9051 > > Added Files: > INSTALL > Log Message: > needed for latest autoconf > > FYI - I had changed the file name earlier as folks compiling on MAC OS X had problems with a INSTALL file and running "make install". Ethan did the same in the Nagios release. Perhaps a MAC OS X specific kludge is required. Wonder if the autoconf folks are thinking about it. -sg -- From nagios at nagios.org Sun Sep 22 20:10:02 2002 From: nagios at nagios.org (Ethan Galstad) Date: Sun Sep 22 20:10:02 2002 Subject: [Nagiosplug-devel] inconsistance between nagios and documentation In-Reply-To: Message-ID: <3D8CEE38.18329.39B0C00@localhost> Thanks for the reminder. Should be in CVS now. On 19 Sep 2002 at 9:45, Martin.Schmitz at naw.de wrote: > hi, > > as i stated earlier in this list, there is an inconsistance between nagios > and the documentation and even between > different parts of the documentation. unfortunately this has not been fixed > in the latest beta. > just compare the description of freshness_threshold in "xodtemplate.html", > "distributed.html" and "freshness.html". > the description in "xodtemplate.html" matches the behavior of nagios. > i think this should be fixed. > > martin > > >Hi, > > > >first, there is an inconsistant description of freshness checks in the > >documentation. > >the freshness_threshold must be given in seconds, but the freshness.html > >says: if set to 5 and interval_length is set to 60 then it will be 5 > >minutes. this isn't true. see paragraph "How The Freshness Threshold > Works" > >the same wrong description is given on the page distributed.html paragraph > >"Freshness Checking". > > > >second: > >I'm providing some passive service checks to nagios without using nsca. > the > >check time is provided by the remote host. the check is executed every 5 > >minutes and freshness_threshold is set to 10 minutes. the problem is, that > >the remote hosts time isn't synchronized with the nagios hosts time. if > the > >remote hosts time is more then 10 minutes after the nagios time, then the > >service states will flap all the time, because each incoming passive > >service check result is detected to be stale. this could be solved by > >synchronizing the times with NTP, but which way should be used if NTP > isn't > >possible. How does NSCA handle this? > >As a workaround i do not use the check time from the remote host, but > >replace it with the local time when passing the result into the external > >command file. any suggestions about a better solution? > > > >martin > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-develMartin Schmitz > net&works > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > Ethan Galstad, Nagios Developer --- Email: nagios at nagios.org Website: http://www.nagios.org From karl at debisschop.net Mon Sep 23 21:02:03 2002 From: karl at debisschop.net (Karl DeBisschop) Date: Mon Sep 23 21:02:03 2002 Subject: [Nagiosplug-devel] Re: [Nagiosplug-checkins] CVS: nagiosplug INSTALL,1.4,1.5 In-Reply-To: References: Message-ID: <1032840072.1090.3.camel@miles.debisschop.net> On Sun, 2002-09-22 at 21:00, Subhendu Ghosh wrote: > > On Sun, 15 Sep 2002, Karl DeBisschop wrote: > > > Update of /cvsroot/nagiosplug/nagiosplug > > In directory usw-pr-cvs1:/tmp/cvs-serv9051 > > > > Added Files: > > INSTALL > > Log Message: > > needed for latest autoconf > > > > > > > FYI - I had changed the file name earlier as folks compiling on MAC OS X > had problems with a INSTALL file and running "make install". Ethan did > the same in the Nagios release. Ughh. > Perhaps a MAC OS X specific kludge is required. Wonder if the autoconf > folks are thinking about it. Any ideas on what such a kludge might look like? ISTM that regardless of the filesystem, make should be case-sensitive. Apparently I'm wrong. Any chance a specific .PHONY designation would help? -- Karl From sghosh at sghosh.org Tue Sep 24 08:53:02 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Tue Sep 24 08:53:02 2002 Subject: [Nagiosplug-devel] Re: plugin overflow error In-Reply-To: <1032844941.1090.11.camel@miles.debisschop.net> Message-ID: On 24 Sep 2002, Karl DeBisschop wrote: > On Sun, 2002-09-22 at 20:02, Ethan Galstad wrote: > > Hi Russell - > > > > I would definitely be interested in knowing what you found, so we can > > get the problem fixed. Subhendu Ghosh has been taking the main lead > > on plugin development lately, Karl DeBisschop has has historically be > > the main lead and still does development, while I rarely do much with > > the plugins anymore. However, if there are serious things that need > > to be taken care of, I will definitely lend a hand to get things > > patched quickly. > > I replaced all instances of sprintf with snprintf. > > I did not (yet) actually check the lengths of the strings -- I just let > snprintf brutally chop off the excess. It's a start. > > A quick grep suggested that check_tcp is OK. > > Check_tcp can replace most of the other things like check_smtp, etc. > Maybe the best way to secure those is to remove them from the CVS tree > at this point and modify the makefile so the appropriate links are > created to get the desired behavior from just the one plugin. If > Subhendu agrees we're ready do to that, it reduces the amount of code > that needs auditing. > > -- > Karl > > I'm all for creating links and basing behaviour on the called name. Less duplication of code, the better the maintenance. If we are going to muck around with the makefiles, I'd like to add an option to define DMALLOC and use dmalloc to check all the memory assignments in a debug mode. I am trying to run check_snmp thru dmalloc. -- -sg From sghosh at sghosh.org Tue Sep 24 10:38:03 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Tue Sep 24 10:38:03 2002 Subject: [Nagiosplug-devel] more info on network management plugins In-Reply-To: <1031827264.9670.107.camel@guy.fw.belnet.be> Message-ID: On 12 Sep 2002, Guy Van Den Bergh wrote: > On Wed, 2002-09-11 at 21:03, Subhendu Ghosh wrote: > > Sorry - don't mean to be nit-picking... > > > Don't worry, discussion is good :) > > > > > > > *) check_xinterface considers also the administrative status of the > > > interface: when the interface is admin down, only a WARNING status is > > > returned (CRITICAL when admin up & operational down). > > > > Is this logical? - often we have interfaces installed on devices that are > > not in use and therefore admin down. If monitoring a specific interface > > (therefore assumption is that it should be up), why would the interface go > > admin down - (if maintenance then scheduling downtime ...) > > > > Inadvertent change of admin to down should get flagged on your > > configuration diffs (You are doing those, right :) > > You have a point, but anyway you can choose in the nagios config whether > you want a notification on admin down or not. If an interface is admin > down, it is (probably) done through manual intervention, maybe even for > a good reason. I still think it is good to treat admin down and > operational down differently. > > > > > By requiring both ifIndex and ifName in the config file you are forcing a > > nms reconfig because of a router reboot with snmp reindexing. Seems to me > > to be at cross-purposes in trying to maintain nms uptime. > > That's true, but I tried to find a balance between nms uptime, snmp > traffic and monitoring the correct interface (read on!). > > > > The current version of check_ifoperstatus supports either ifIndex or > > ifDescr for the interface. It could be improved to use ifName instead of > > ifDescr if the -I (support for ifXTable) is provided. > > > It is indeed possible to provide only ifName or ifDescr, and get the > correct index from the router with snmp. But I think this might be a > problem on routers with a large number of interfaces. Excessive traffic > can be solved by storing a mapping ifName->ifIndex locally and let the > plugin use this data when available. But I'm not sure whether this is a > good idea for plugin performance. Any ideas? > Another possibility is to get the index when only ifName or ifDescr is > provided, use the index directly when provided, and ultimately make the > comparison as I am doing now when both are provided. > There had been a discussion earlier about supporting a cache/tmp directory for this kind of data - similar to the metadat that is stored by Cricket on snmp indexes. I'll look into the perl-cache and see if that helps. One of the issues with caching this info is where to cache. My preference is to cache in memory or on a memory filesytem to prevent contribution to diskio bottlenecks. > > > *) check_xinterface returns UNKNOWN when the snmp poll fails > > > (check_ifoperstatus returns critical). SNMP implementations on > > > commercial routers are pretty stable. Most of the time an SNMP poll > > > failure means the router is down, and this is detected with the > > > check-host-alive command. > > > > True - but having a critical here allows for faster notification rather > > than waiting for the host-check max-attempts to expire. > > I'd rather wait for that to be really sure the host is down. > You can have a condition where a link is lost, which makes a router > unreachable. I will receive 2 notifications: host down and interface > down (on the router still reachable). You will get at least 3 > notifications with ifoperstatus.pl (one interface down and at least one > unreachable and one host down). xinterface can return all states: > unknown, ok, warning and critical; ifoperstatus only returns ok and > critical, and unknown on a condition which will not be met very often > (plugin timeout instead of snmp session timeout). > OK, I'll accept this :) Here's what I would propose - merge the changes from check_xinterface and check_ifoperstatus into a new check_snmp_interface. This would allow the name change to distinguish the changed functionality. > > > 2. The router environment plugins. > > > It is indeed a good idea to fold both check_cisco_env and > > > check_juniper_env into a single plugin, but I will need some more time > > > to implement this. This way it should be easily extensible with other > > > proprietary environment MIBs (Foundry, Unisphere, Alcatel, ...) > > > > > I can give you a hand on this, if you'd like. > > > Welcome aboard ;) I was thinking of transforming the two plugins into > functions, and make the check_router_env decide whether it should call > the cisco_env function or the juniper_env function. Any suggestions? > functions would be the easiest way to go. We may want to appropriately flag cases where the device may not be able to return all of the information. -sg -- From sghosh at sghosh.org Wed Sep 25 06:39:08 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Wed Sep 25 06:39:08 2002 Subject: [Nagiosplug-devel] RE: [Nagios-users] performance data from plugins - does it exist? In-Reply-To: <1032004202.18622.30.camel@miles.debisschop.net> Message-ID: On 14 Sep 2002, Karl DeBisschop wrote: > > I do feel that performance data should be part of the formal 1.3.0 > release, although it's never been discussed to my knowlege. I just don't > want to spend time logging performance data for every concievable > variable on this pass, especailly if it requires tracking new timers and > varibles for them, and other ancillary coding. I'd rather focus on > getting a formal release that includes an acceptable level of detail > done in a way that the most (all?) users and developers feel makes > sense. > I would prefer to make the performance data part of the 1.3.x release and release 1.3.0 with additional stable plugins. It would also be useful to discuss the overall size of the retrun string and its impact in the nagios architecture. We are currently limited by the size on the non-interleaved pipe message size for passively submitted results. Do we want to differentiate plugins between active and passive (I would think not..) I thinks if a list of parameters to be measured from the existing plugins could be developed (via contributions :) then we could decide on a base set of parameters and naming guidelines for the parameters. >From a diskio perspective, I would like to minimize or coordinate diskio as much as possible for the perfdata - does this mean that nagios core would have to support aggregate perfdata in addition to aggregate status? -- -sg From atonns at mail.ivillage.com Wed Sep 25 07:56:04 2002 From: atonns at mail.ivillage.com (atonns at mail.ivillage.com) Date: Wed Sep 25 07:56:04 2002 Subject: [Nagiosplug-devel] RE: [Nagios-users] performance data from p lugins - does it exist? Message-ID: > From a diskio perspective, I would like to minimize or coordinate diskio > as much as possible for the perfdata - does this mean that nagios core > would have to support aggregate perfdata in addition to aggregate status? my gut feel on this is to let the open source model work in your favor. it looks like the general populace hasn't moaned or groaned about the fact that performance data is missing. however, there are a few that would like to have the perf data (and generally know what they want to do with it). i think that once the data is provided with the plugins, a few methods for rationally collecting / displaying this data will arise. the core developers can take the one that fits best with the nagios core and integrate it later. or possibly keep it managed as a "key addon" like nrpe is right now. -- "Computer science is as much about computers as astronomy is about telescopes" -- Edsger Dijkstra --------------------------------------------------------- Anthony Tonns, UNIX Administrator - atonns at mail.ivillage.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Richard.Wu at fusepoint.com Wed Sep 25 10:54:02 2002 From: Richard.Wu at fusepoint.com (Richard Wu) Date: Wed Sep 25 10:54:02 2002 Subject: [Nagiosplug-devel] RE: [Nagios-users] performance data from plugins - does it exist? Message-ID: <77F055FA968580429F4546414D8C10E70C2F4D@s102b.rhcci.net> Hi, sg: Glad to hear that perfdata will be addressed in the core level. It is useful for users to look back for a while and do the trending. However, not every monitor is candidate for perfdata, only some of them are interested. So if you can put a perdata configuration per monitor level, it will be very helpful. Richard Wu -----Original Message----- From: Subhendu Ghosh [mailto:sghosh at sghosh.org] Sent: Wednesday, September 25, 2002 6:38 AM To: Karl DeBisschop Cc: Jeremy Tinley; nagiosplug-devel at lists.sourceforge.net; nagios-users at lists.sourceforge.net Subject: Re: [Nagiosplug-devel] RE: [Nagios-users] performance data from plugins - does it exist? On 14 Sep 2002, Karl DeBisschop wrote: > > I do feel that performance data should be part of the formal 1.3.0 > release, although it's never been discussed to my knowlege. I just don't > want to spend time logging performance data for every concievable > variable on this pass, especailly if it requires tracking new timers and > varibles for them, and other ancillary coding. I'd rather focus on > getting a formal release that includes an acceptable level of detail > done in a way that the most (all?) users and developers feel makes > sense. > I would prefer to make the performance data part of the 1.3.x release and release 1.3.0 with additional stable plugins. It would also be useful to discuss the overall size of the retrun string and its impact in the nagios architecture. We are currently limited by the size on the non-interleaved pipe message size for passively submitted results. Do we want to differentiate plugins between active and passive (I would think not..) I thinks if a list of parameters to be measured from the existing plugins could be developed (via contributions :) then we could decide on a base set of parameters and naming guidelines for the parameters. >From a diskio perspective, I would like to minimize or coordinate diskio as much as possible for the perfdata - does this mean that nagios core would have to support aggregate perfdata in addition to aggregate status? -- -sg ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Nagios-users mailing list Nagios-users at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users From sghosh at sghosh.org Wed Sep 25 11:38:10 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Wed Sep 25 11:38:10 2002 Subject: [Nagiosplug-devel] RE: [Nagios-users] performance data from plugins - does it exist? In-Reply-To: <77F055FA968580429F4546414D8C10E70C2F4D@s102b.rhcci.net> Message-ID: Hi Richard Perfdata is available on a per service check instance basis and the Nagios core will do nothing more than pass it on to the perfdata handler or a file. Each service check command would have to have appropriate flags enabled for the plugin to return the perfdata. As Karl had mentioned in another thread, contribution on what plugin should return what perfdata would be most welcome and would speed the process. -sg On Wed, 25 Sep 2002, Richard Wu wrote: > Hi, sg: > > Glad to hear that perfdata will be addressed in the core level. It is > useful for users to look back for a while and do the trending. > However, not every monitor is candidate for perfdata, only some of them > are interested. So if you can put a perdata configuration per monitor > level, it will be very helpful. > > Richard Wu > > > -----Original Message----- > From: Subhendu Ghosh [mailto:sghosh at sghosh.org] > Sent: Wednesday, September 25, 2002 6:38 AM > To: Karl DeBisschop > Cc: Jeremy Tinley; nagiosplug-devel at lists.sourceforge.net; > nagios-users at lists.sourceforge.net > Subject: Re: [Nagiosplug-devel] RE: [Nagios-users] performance data from > plugins - does it exist? > > > On 14 Sep 2002, Karl DeBisschop wrote: > > > > > > I do feel that performance data should be part of the formal 1.3.0 > > release, although it's never been discussed to my knowlege. I just don't > > want to spend time logging performance data for every concievable > > variable on this pass, especailly if it requires tracking new timers and > > varibles for them, and other ancillary coding. I'd rather focus on > > getting a formal release that includes an acceptable level of detail > > done in a way that the most (all?) users and developers feel makes > > sense. > > > > I would prefer to make the performance data part of the 1.3.x release and > release 1.3.0 with additional stable plugins. > > It would also be useful to discuss the overall size of the retrun string > and its impact in the nagios architecture. We are currently limited by > the size on the non-interleaved pipe message size for passively submitted > results. Do we want to differentiate plugins between active and passive > (I would think not..) > > I thinks if a list of parameters to be measured from the existing plugins > could be developed (via contributions :) then we could decide on a base > set of parameters and naming guidelines for the parameters. > > >From a diskio perspective, I would like to minimize or coordinate diskio > as much as possible for the perfdata - does this mean that nagios core > would have to support aggregate perfdata in addition to aggregate status? > > -- From kdebisschop at alert.infoplease.com Wed Sep 25 19:03:06 2002 From: kdebisschop at alert.infoplease.com (Karl DeBisschop) Date: Wed Sep 25 19:03:06 2002 Subject: [Nagiosplug-devel] Roadmap to 1.3.0 Message-ID: <1033005760.1112.16.camel@miles.debisschop.net> I'd like to consider creating a clearcut roadmap to a 1.3.0 release. I agree that plugin stablility is key. There are also some vague thoughts in the ROADMAP file. But right now, AFAICT, there is no real threshold for saying when we should call it a release. Have people been thinking about this? If so, care to share your thoughts? -- Karl From sghosh at sghosh.org Thu Sep 26 20:25:05 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Thu Sep 26 20:25:05 2002 Subject: [Nagiosplug-devel] Roadmap to 1.3.0 In-Reply-To: <1033005760.1112.16.camel@miles.debisschop.net> Message-ID: On 25 Sep 2002, Karl DeBisschop wrote: > I'd like to consider creating a clearcut roadmap to a 1.3.0 release. > > I agree that plugin stablility is key. There are also some vague > thoughts in the ROADMAP file. > > But right now, AFAICT, there is no real threshold for saying when we > should call it a release. > > Have people been thinking about this? > > If so, care to share your thoughts? > I think the threshold for 1.3.0 should be fixes for the known issues/patches that have been posted. (form mailing list and patch list on sourceforge) - check_snmp memory allocation - check_snmp - mibdir and snmpv3 support - check_smtp - remove ifdef and move functionality to an option. - check_hpjd - not NULL community - check_http - client certificate - check_http - Russel's patches - check_snmp_interface - merge check_ifoperstatus and check_xinterface - check_nntp - -g support Optional - merge check_smtp and check_nntp changes back into check_tcp and create a symlink target. This creates a question for check_smtp - can we provide additional options for specific versions? Note: the ROADMAP says 1.3.x is a devel branch and fixes are going to be added to the 1.2.9 branch. Since we started nagiosplug as a new CVS project, is this still true? Other comments? -- -sg From karl at debisschop.net Fri Sep 27 03:58:05 2002 From: karl at debisschop.net (Karl DeBisschop) Date: Fri Sep 27 03:58:05 2002 Subject: [Nagiosplug-devel] Roadmap to 1.3.0 In-Reply-To: References: Message-ID: <1033124235.1129.7.camel@miles.debisschop.net> On Thu, 2002-09-26 at 23:24, Subhendu Ghosh wrote: > On 25 Sep 2002, Karl DeBisschop wrote: > > > I'd like to consider creating a clearcut roadmap to a 1.3.0 release. > > > > I agree that plugin stablility is key. There are also some vague > > thoughts in the ROADMAP file. > > > > But right now, AFAICT, there is no real threshold for saying when we > > should call it a release. > > > > Have people been thinking about this? > > > > If so, care to share your thoughts? > > > > I think the threshold for 1.3.0 should be fixes for the known > issues/patches that have been posted. (form mailing list and patch list on > sourceforge) > > - check_snmp memory allocation > - check_snmp - mibdir and snmpv3 support > - check_smtp - remove ifdef and move functionality to an option. > - check_hpjd - not NULL community > - check_http - client certificate > - check_http - Russel's patches > - check_snmp_interface - merge check_ifoperstatus and check_xinterface > - check_nntp - -g support > > > > Optional - merge check_smtp and check_nntp changes back into check_tcp and > create a symlink target. This creates a question for check_smtp - can we > provide additional options for specific versions? We can, but only to the extent that is help code management. As an example, it's pretty clear that we will not merger check_http with check_tcp. So it pretty much depends on how many options, and how complex they are. > Note: the ROADMAP says 1.3.x is a devel branch and fixes are going to be > added to the 1.2.9 branch. Since we started nagiosplug as a new > CVS project, is this still true? I really doesn't matter to me. I was only going that way because other people on the list had suggested it, and a slim majority seemed to prefer it. > Other comments? I'm looking into the possibility of removing all sprintf code, or at least doing an audit to ensure there are no potential buffer overfolws possibilities. Also, I need to be sure that all of the reverse compatibility option processing ind ripped out. THat caode was bug ridden. May already be done, but I need to check. From sghosh at sghosh.org Fri Sep 27 05:44:03 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Fri Sep 27 05:44:03 2002 Subject: [Nagiosplug-devel] Roadmap to 1.3.0 In-Reply-To: <1033124235.1129.7.camel@miles.debisschop.net> Message-ID: On 27 Sep 2002, Karl DeBisschop wrote: > On Thu, 2002-09-26 at 23:24, Subhendu Ghosh wrote: > > On 25 Sep 2002, Karl DeBisschop wrote: > > > > > > Optional - merge check_smtp and check_nntp changes back into check_tcp and > > create a symlink target. This creates a question for check_smtp - can we > > provide additional options for specific versions? > > We can, but only to the extent that is help code management. As an > example, it's pretty clear that we will not merger check_http with > check_tcp. So it pretty much depends on how many options, and how > complex they are. agreed. > > > Note: the ROADMAP says 1.3.x is a devel branch and fixes are going to be > > added to the 1.2.9 branch. Since we started nagiosplug as a new > > CVS project, is this still true? > > I really doesn't matter to me. I was only going that way because other > people on the list had suggested it, and a slim majority seemed to > prefer it. > > > Other comments? > > I'm looking into the possibility of removing all sprintf code, or at > least doing an audit to ensure there are no potential buffer overfolws > possibilities. > > Also, I need to be sure that all of the reverse compatibility option > processing ind ripped out. THat caode was bug ridden. May already be > done, but I need to check. > Sorry - some of the reverse compatibility code still exists :( -- -sg From sghosh at sghosh.org Fri Sep 27 08:24:03 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Fri Sep 27 08:24:03 2002 Subject: [Nagiosplug-devel] 1.3.0 Message-ID: Karl regarding sprintf and snprintf Earlier there was post (Aug 25 - nagios-devel) about using snprintf from the samba distribution because it handled floats whereas the current one does not. Don't know if that affects the plugins as well. -- -sg From wpratt at megapath.net Fri Sep 27 13:24:02 2002 From: wpratt at megapath.net (William Pratt) Date: Fri Sep 27 13:24:02 2002 Subject: [Nagiosplug-devel] Bug in check_disk plugin from 1.3.0-alpha Message-ID: <7890E58494115C4C8D864A0E1211D5AA0307300F@alpine.megapath.net> When running check_disk using percents instead of kb's the behavior of the program changes if you specify a certain partition. Here is an example: ./check_disk -w20% -c10% - this will warn you if MORE than 20% of your disk is FREE ./check_disk -w20% -c10% -p/dev/sda1 - this will warn you if LESS than 20% of your disk is FREE According to the plugin documentation, the latter of the 2 is incorrect. Sincerely, William Pratt Unix Systems Engineer MegaPath Networks, Inc http://www.MegaPath.net From karl at debisschop.net Fri Sep 27 22:27:02 2002 From: karl at debisschop.net (Karl DeBisschop) Date: Fri Sep 27 22:27:02 2002 Subject: [Nagiosplug-devel] 1.3.0 In-Reply-To: References: Message-ID: <1033190794.1090.12.camel@miles.debisschop.net> On Fri, 2002-09-27 at 11:23, Subhendu Ghosh wrote: > > Karl > > regarding sprintf and snprintf > > Earlier there was post (Aug 25 - nagios-devel) about using snprintf from > the samba distribution because it handled floats whereas the current one > does not. > > Don't know if that affects the plugins as well. Always looking for a better snprintf... We should look into it, it does look like the implementaion in the plugins has the have problem. I might be able to do that sometime over the weekend. -- Karl From karl at debisschop.net Fri Sep 27 23:04:01 2002 From: karl at debisschop.net (Karl DeBisschop) Date: Fri Sep 27 23:04:01 2002 Subject: [Nagiosplug-devel] 1.3.0 In-Reply-To: <1033190794.1090.12.camel@miles.debisschop.net> References: <1033190794.1090.12.camel@miles.debisschop.net> Message-ID: <1033193010.1090.19.camel@miles.debisschop.net> On Sat, 2002-09-28 at 01:26, Karl DeBisschop wrote: > On Fri, 2002-09-27 at 11:23, Subhendu Ghosh wrote: > > > > Karl > > > > regarding sprintf and snprintf > > > > Earlier there was post (Aug 25 - nagios-devel) about using snprintf from > > the samba distribution because it handled floats whereas the current one > > does not. > > > > Don't know if that affects the plugins as well. > > Always looking for a better snprintf... > > We should look into it, it does look like the implementaion in the > plugins has the have problem. > > I might be able to do that sometime over the weekend. I haven't fully integrated it yet, but I did download it. Seems very worthwhile, as it also includes asprintf, which basically does what my ssprintf does. Except sambe gets far more auditing than I do. I strongly feel that a writing a simple C plugin should not need you to be a memory allocation guru. That was what I tried to do with ssprintf. asprintf does it better. So I'm going to try hooking the new sfprintf.c into the configure/build. Then the sprintf calls that should be replaced can call asprintf with exactly the same syntax. Eventually, we can stop using my ssprintf entirely, and delete it! -- Karl From sghosh at sghosh.org Sun Sep 29 11:16:04 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Sun Sep 29 11:16:04 2002 Subject: [Nagiosplug-devel] 1.3.0 In-Reply-To: <1033193010.1090.19.camel@miles.debisschop.net> Message-ID: On 28 Sep 2002, Karl DeBisschop wrote: > On Sat, 2002-09-28 at 01:26, Karl DeBisschop wrote: > > On Fri, 2002-09-27 at 11:23, Subhendu Ghosh wrote: > > > > > > Karl > > > > > > regarding sprintf and snprintf > > > > > > Earlier there was post (Aug 25 - nagios-devel) about using snprintf from > > > the samba distribution because it handled floats whereas the current one > > > does not. > > > > > > Don't know if that affects the plugins as well. > > > > Always looking for a better snprintf... > > > > We should look into it, it does look like the implementaion in the > > plugins has the have problem. > > > > I might be able to do that sometime over the weekend. > > I haven't fully integrated it yet, but I did download it. > > Seems very worthwhile, as it also includes asprintf, which basically > does what my ssprintf does. Except sambe gets far more auditing than I > do. > > I strongly feel that a writing a simple C plugin should not need you to > be a memory allocation guru. That was what I tried to do with ssprintf. > asprintf does it better. So I'm going to try hooking the new sfprintf.c > into the configure/build. Then the sprintf calls that should be replaced > can call asprintf with exactly the same syntax. > > Eventually, we can stop using my ssprintf entirely, and delete it! > Ok - another item for cleanup before the 1.4 relase :) If you get a chance to commit the changes, I try and use them for the fixes in check_snmp as well. -- -sg From sghosh at sghosh.org Mon Sep 30 20:15:02 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Mon Sep 30 20:15:02 2002 Subject: [Nagiosplug-devel] Bug in check_disk plugin from 1.3.0-alpha In-Reply-To: <7890E58494115C4C8D864A0E1211D5AA0307300F@alpine.megapath.net> Message-ID: On Fri, 27 Sep 2002, William Pratt wrote: > When running check_disk using percents instead of kb's the behavior of the > program changes if you specify a certain partition. Here is an example: > > ./check_disk -w20% -c10% - this will warn you if MORE than 20% of your disk > is FREE > > ./check_disk -w20% -c10% -p/dev/sda1 - this will warn you if LESS than 20% > of your disk is FREE > > According to the plugin documentation, the latter of the 2 is incorrect. > > Sincerely, > > William Pratt > Unix Systems Engineer > MegaPath Networks, Inc > http://www.MegaPath.net > > Could you file a bug report on SourceForge. Thanks -sg --