[Nagiosplug-devel] performance data patch for check_ping.c

Thomas Guyot-Sionnest dermoth at aei.ca
Wed May 7 09:12:44 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/05/08 10:58 AM, Christian Schneemann wrote:
> On Wednesday April 23 2008 08:36:18 pm Thomas Guyot-Sionnest wrote:
>> Christian Schneemann wrote:
> [...]
>> Thanks for your time,
> Hi,
> thanks for the small documentation, I gave it a new try ;)
> 
> With the test if the threshold is set and with packetloss.
> 
> --- plugins/check_ping.c
> +++ plugins/check_ping.c
> @@ -165,7 +165,11 @@
>  							state_text (this_result), warn_text, pl, rta);
>  		if (display_html == TRUE)
>  			printf ("</A>");
> -		printf ("\n");
> +		char * data_rta = NULL;
> +		char * data_pl = NULL;
> +		asprintf(&data_rta, "%s", fperfdata ("rta", (double) rta, "ms", 
> wrta>0?TRUE:FALSE, wrta, crta>0?TRUE:FALSE, crta, TRUE, 0, FALSE, 0));
> +		asprintf(&data_pl, "%s", perfdata ("pl", (long) pl, "%", wpl>0?TRUE:FALSE, 
> wpl, cpl>0?TRUE:FALSE, cpl, FALSE, 0, FALSE, 0));
> +		printf("|%s %s\n",data_rta, data_pl);
>  
>  		if (verbose >= 2)
>  			printf ("%f:%d%% %f:%d%%\n", wrta, wpl, crta, cpl);

Thank you. I will commit that to svn.

Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIIVZs6dZ+Kt5BchYRAlYZAJ9pWWBfLEYa2qKRqKCdZlamMrJVBACfc9rR
kvzd6tTMSKDBKynMIz8R0Xs=
=Y/2/
-----END PGP SIGNATURE-----




More information about the Devel mailing list