[Nagios-users] How to make check_ntp NOT report its offset performance data using scientific notation?

2009-05-28 Thread Steffen Poulsen
We were wondering, is there any possible way we can avoid having check_nrpe 
report its offset performance data in scientific notation?

We would like to graph the offset under all circumstances, but sometimes it is 
unfortunately reported as:

offset=2.577755367e-05

And this gives us some trouble, as we would of course like to avoid having this 
graphed as 2.577 seconds (we are currently using NagiosGrapher for graphing).

If NagiosGrapher can be tweaked to accept the scientific notation reported, 
that would be another useful strategy - please enlighten us if you know how to 
achieve this .. :-)

---

Just for curiosity, what we currently do when graphing is accepting only the 
checks that do not use scientific notation:

2009-05-28 15:32:54 PIPE: fqdn check_ntp   offset=2.577755367e-05  
offset=2.577755367e-05
2009-05-28 15:32:54 REGEX: 1 blocks for 'check_ntp' found.
2009-05-28 15:32:54 REGEX: graph_value=difference
2009-05-28 15:32:54 REGEX: output=perfdata
2009-05-28 15:32:54 REGEX: regex=m/offset=([-+\d]+\.\d+)(s| |$)/i
2009-05-28 15:32:54 REGEX: perfdata=offset=2.577755367e-05
2009-05-28 15:32:54 REGEX: NO MATCH.

Best regards,
Steffen Poulsen

--

Venlig hilsen / Best regards

Steffen Poulsen
UNIX System Administrator
TDC Hosting A/S
Phone: +45 70 26 25 27
E-mail: s...@tdchosting.dkmailto:b...@tdchosting.dk
Web: www.tdchosting.dkhttp://www.tdchosting.dk/

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA,  Big Spaceship. http://p.sf.net/sfu/creativitycat-com ___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Re: [Nagios-users] How to make check_ntp NOT report its offset performance data using scientific notation?

2009-05-28 Thread Assaf Flatto
Hello 

Can you post your  a section of your nagiosgraph.log that shows that data 
retrieved for the ntp 
check and the related section from the map file ?

Those two things will help a lot .

Assaf

On Thursday 28 May 2009 13:49:31 Steffen Poulsen wrote:
 We were wondering, is there any possible way we can avoid having check_nrpe
 report its offset performance data in scientific notation?

 We would like to graph the offset under all circumstances, but sometimes it
 is unfortunately reported as:

 offset=2.577755367e-05

 And this gives us some trouble, as we would of course like to avoid having
 this graphed as 2.577 seconds (we are currently using NagiosGrapher for
 graphing).

 If NagiosGrapher can be tweaked to accept the scientific notation reported,
 that would be another useful strategy - please enlighten us if you know how
 to achieve this .. :-)

 ---

 Just for curiosity, what we currently do when graphing is accepting only
 the checks that do not use scientific notation:

 2009-05-28 15:32:54 PIPE: fqdn check_ntp   offset=2.577755367e-05 
 offset=2.577755367e-05 2009-05-28 15:32:54 REGEX: 1 blocks for 'check_ntp'
 found.
 2009-05-28 15:32:54 REGEX: graph_value=difference
 2009-05-28 15:32:54 REGEX: output=perfdata
 2009-05-28 15:32:54 REGEX: regex=m/offset=([-+\d]+\.\d+)(s| |$)/i
 2009-05-28 15:32:54 REGEX: perfdata=offset=2.577755367e-05
 2009-05-28 15:32:54 REGEX: NO MATCH.

 Best regards,
 Steffen Poulsen

 --

 Venlig hilsen / Best regards

 Steffen Poulsen
 UNIX System Administrator
 TDC Hosting A/S
 Phone: +45 70 26 25 27
 E-mail: s...@tdchosting.dkmailto:b...@tdchosting.dk
 Web: www.tdchosting.dkhttp://www.tdchosting.dk/



-- 
Assaf Flatto
SSP Ops Team
Linux System Administrator
169 Euston Road, London, NW1 2AE

Along with a few colleagues I am doing The Three Peaks Challenge again 
this year to raise money for The Railway Children.
Please sponsor me by making a donation online, simply click on the link 
below and give via your switch/credit card. Thank you.
http://www.justgiving.com/londonnorththreepeaks




IMPORTANT . this email and the information in it may be confidential, legally
privileged and/or protected by law. It is intended solely for the use of the
person to whom it is addressed. If you are not the intended recipient, please
notify the sender immediately and do not disclose the contents to any other
person, use it for any purpose, or store or copy the information in any medium.
Please also delete all copies of this email and any attachments from your
system.

We cannot guarantee the security or confidentiality of email communications. We
do not accept any liability for losses or damages that you may suffer as a
result of your receipt of this email including but not limited to computer
service or system failure, access delays or interruption, data non-delivery or
mis-delivery, computer viruses or other harmful components.

Copyright in this email and any attachments belong to Select Service Partner UK
Limited. Should you communicate with anyone at Select Service Partner UK 
Limited by
email, you consent to us monitoring and reading any such correspondence.

Nothing in this email shall be taken or read as suggesting, proposing or
relating to any agreement concerted practice or other practice that could
infringe UK or EC competition legislation.

Select Service Partner UK Limited is a company registered in England and Wales
(company number 05687183) whose registered office is at 1 The Heights, 
Brooklands, Weybridge. Surrey. KT13 0NY
 
 

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA,  Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] How to make check_ntp NOT report its offset performance data using scientific notation?

2009-05-28 Thread Marc Powell

On May 28, 2009, at 8:49 AM, Steffen Poulsen wrote:

 We were wondering, is there any possible way we can avoid having  
 check_nrpe report its offset performance data in scientific notation?


In check_ntp.c, change (around line 820) and recompile --

 } else {
 asprintf(result_line, %s %s %.10g secs,  
result_line, _(Offset), offset);

to
 } else {
 asprintf(result_line, %s %s %.10f secs,  
result_line, _(Offset), offset);


YMMV.

http://www.cplusplus.com/reference/clibrary/cstdio/printf/

--
Marc


--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA,  Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null