[Nagiosplug-devel] question about check_log2.pl

Willis Ralph Willis.Ralph at asx.com.au
Fri Mar 1 05:52:15 CET 2013


Thanks for the help.

The extra quotes didn’t help , Nagios still removes the string at the first “|”

Your post made me think and I ended up changing the  $pattern_line before it is sent to Nagios.

my $x = '\|';
        $pattern_line =~ s/$x/*/g;
        print "($pattern_count): $pattern_line";

This code changed the | to a * which solved my problem

Thanks for the help

Regards,
Willis


From: lists [mailto:lists at catsnest.co.uk]
Sent: Wednesday, 27 February 2013 11:07 PM
To: Nagios Plugin Development Mailing List
Subject: Re: [Nagiosplug-devel] question about check_log2.pl


On 27 February 2013 02:36, Willis Ralph <Willis.Ralph at asx.com.au<mailto:Willis.Ralph at asx.com.au>> wrote:

Hi,

I have been making use of check_log2.pl<http://check_log2.pl>. It works fine. When I ran it from the command line on my Nagios server the output is correct.


/usr/local/nagios/libexec/check_nrpe -H server111   -c check_logfiles

This brings back


WARNING: (3): [LOG|ERROR|27 Feb 2013 10:52:36,683|com.example.Bean|Worker-2|-]


The trouble is that the Nagios monitoring screen output in the Status Information field treats the first “| “ as a delimiter and truncates the output  to

[LOG|

Is there a way to make Nagios display the complete line ?


This will be becouse Nagios treats anything after a | in the output of a check as performance data.
You will need to etit the script to work with your data, I think if the output is quoted the | will be ignored, if that does not work try urlencoding it instead.


e.g. In the version of check_log2.pl<http://check_log2.pl>.i have the output line looks like this:

        print "($pattern_count): $pattern_line";

you could try

        print "($pattern_count): \"$pattern_line\"";

--
Regards,
Ritchie

Regards,
Willis

Willis Ralph | Systems Administrator
ASX Limited | 20 Bridge Street | Sydney  NSW  2000
t:  +61 2 9227 0661 | m: 0417 652755 | e:
w:  www.asx.com.au<http://www.asx.com.au>
P Please consider the environment before printing this email








PRIVACY COLLECTION STATEMENT

ASX uses and discloses your personal information only for the purpose for

which you provided it. Your personal information will not be disclosed or used

for any other purpose unless you consent or ASX is otherwise permitted to do

so under the Privacy Act 1988 (Cth).



CONFIDENTIAL EMAIL

The information in this email is confidential and may be privileged or subject

to copyright. It is intended for the exclusive use of the addressee(s). If you

are not an addressee, do not copy, distribute or otherwise act on the email.

If you have received the email in error, please contact the sender immediately

and delete the email.  The unauthorised use of this email may result in

liability for breach of confidentiality, privilege or copyright. E-mail

transmissions cannot be guaranteed to be secure or error-free as information

could be intercepted, corrupted, lost, destroyed, arrive late or incomplete,

or contain viruses. The sender therefore does not accept liability for errors

or omissions in the contents of this message which arise as a result of e-mail

transmission.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________________
Nagios Plugin Development Mailing List Nagiosplug-devel at lists.sourceforge.net<mailto:Nagiosplug-devel at lists.sourceforge.net>
Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
::: Please include plugins version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null




PRIVACY COLLECTION STATEMENT
ASX uses and discloses your personal information only for the purpose for
which you provided it. Your personal information will not be disclosed or used
for any other purpose unless you consent or ASX is otherwise permitted to do
so under the Privacy Act 1988 (Cth).

CONFIDENTIAL EMAIL
The information in this email is confidential and may be privileged or subject
to copyright. It is intended for the exclusive use of the addressee(s). If you 
are not an addressee, do not copy, distribute or otherwise act on the email. 
If you have received the email in error, please contact the sender immediately 
and delete the email.  The unauthorised use of this email may result in 
liability for breach of confidentiality, privilege or copyright. E-mail 
transmissions cannot be guaranteed to be secure or error-free as information 
could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, 
or contain viruses. The sender therefore does not accept liability for errors 
or omissions in the contents of this message which arise as a result of e-mail
transmission.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20130301/bcc1eb76/attachment.html>


More information about the Devel mailing list