[Nagiosplug-help] RE : RE : check_nt counter with coma problem

NAYRAT Adrien adrien.nayrat at brest-metropole-oceane.fr
Fri Jun 20 08:40:18 CEST 2008


Hi all,
I found an alternative solution which works with accents and coma !
I use NRPE with nsclient++
In the NSC.ini: 
Under : 



	[NRPE Handlers]


Add the following line (for the counter Counter:Ecriture disque/s=\Disque physique(_Total)\Écritures disque, octets/s)  :


	    check_count=inject checkCounter "Counter:Ecriture disque/s=\Disque physique(_Total)\Écritures disque, octets/s" ShowAll MaxWarn=50000 MaxCrit=100000
	 

And you can test from the server :


	$./check_nrpe -H hcu11 -p 5666 -c check_count
	OK: Ecriture disque/s: 2063.39|'Ecriture disque/s'=2063.39;50000;100000;



Great!

To obtain the list of the counters :


	nsclient++.exe CheckSystem listpdh
	 

Easy ;)
 

	-----Message d'origine-----
	De : Anthony Montibello [mailto:amontibello at gmail.com] 
	Envoyé : vendredi 20 juin 2008 01:41
	À : NAYRAT Adrien
	Cc : nagiosplug-help at lists.sourceforge.net
	Objet : Re: RE : [Nagiosplug-help] check_nt counter with coma problem
	
	
	THe counter name can be changed in the Windows Registry, However this should be tested before implementing in production
	 
	TOny (Author of NC_Net)
	
	
	On Thu, Jun 19, 2008 at 3:37 AM, NAYRAT Adrien <adrien.nayrat at brest-metropole-oceane.fr> wrote:
	

		I  found the problem.. The problem is in this function :
		strtok (value_list, "&");
		 
		It replace the coma "," by a "&". Even if the coma is in the name of the counter.
		 
		Why microsoft put coma in the name of the french counters!
		 


			On Wed, Jun 18, 2008 at 8:58 AM, NAYRAT Adrien <adrien.nayrat at brest-metropole-oceane.fr> wrote:
			


				Hello,
				
				I have a problem with the check_nt plugin, with the counter variable.
				When the name of the counter contain a coma "," check_nt use the text after the coma as a description :
				For example :
				The counter is :
				       \Disque physique(_Total)\Lectures disque, octets/s
				
				My command line is :
				       ./check_nt -H hcu11  -p 1248 -v COUNTER  -s "public" -l "\\Disque physique(_Total)\\Lectures disque, octets/s"
				
				I modified the sources, and I had some printf:
				
				
				Here ==>>               printf ("\nvalue list : %s\n",value_list);
				               if (value_list == NULL)
				                       output_message = strdup (_("No counter specified"));
				               else
				       ........
				                       else if ((counter_unit == NULL) && (description != NULL))
				                               {
				Here ==>>                               printf("\ncounter_unit %s, description %s\n",counter_unit,description);
				                                       output_message = strdup (_("No unit counter specified"));
				                                       }
				                       if (allRight)
				                       {.......
				
				
				And the result of the command line is :
				       m9427:/usr/lib/nagios/plugins/libexec# ./check_nt -H hcu11  -p 1248 -v COUNTER  -s "public" -l "\\Disque physique(_Total)\\Lectures disque, octets/s"
				
				       value list : \Disque physique(_Total)\Lectures disque, octets/s
				
				       counter_unit (null), description  octets/s
				       No unit counter specified
				
				
				I also try with
				       ./check_nt -H hcu11  -p 1248 -v COUNTER  -s "public" -l "\\Disque physique(_Total)\\Lectures disque\, octets/s"
				The result is the same.
				
				
				I hope we will find a solution.
				PS : Before this problem I have had problems with the accents "é" solved by using a perl script :
				       #!/usr/bin/perl
				
				       $response2 = `/usr/lib/nagios/plugins/libexec/check_nt -H $ARGV[0] -p 1248 -v COUNTER  -s "public" -l "\\Disque physique(_Total)\\Lectures disque\\, octets/s"`;
				       chomp $response2;
				       ($used) = ($response2);
				
				       print "$response2\n";
				
				
				Thanks you for your help, I'm a french user of nagios ;)
				
				
				Adrien NAYRAT
				Apprenti Ingénieur Réseaux et Télécommunications
				DIT - Brest-Métropole-Océane
				6, Boulevard de l'Europe
				Tel/fax 02.98.34.30.19
				adrien.nayrat at brest-metropole-oceane.fr


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20080620/e1a27e78/attachment.html>


More information about the Help mailing list