[Nagios-devel] Update to sample Perl code in FAQ ID: F0070

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] Update to sample Perl code in FAQ ID: F0070

Post by Guest »

--ReaqsoxgOBHFXBhH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi, all. Just joined the list as I wanted to point out something I noticed
in FAQ ID: F0070 at
http://www.nagios.org/faqs/viewfaq.php? ... &showdesc=
=3Dtrue

First off, and somewhat oddly, the browser is eating a couple of bits of
angle-bracketed code, even though it's inside tags. Not sure
why that is, but it happens in both Galeon and Mozilla. Looking at the
page source you can see the '' and '' parts plain as
day (Both browsers are actually helpful enough to highlight them for me
since they think they're HTML tags.)

I also found a reference to a subroutine of some sort which doesn't appear
to ship with the fairly vanilla Perl on my Linux box (v5.8.0 built for
i386-linux-thread-multi). Not sure if it's a CPAN module, or someone's own
function from their personal library that they just forgot about, or maybe
even a weird robo-translation error that crept in by the webserver or FAQ
database. In any event, it seems that the call to 'concat' doesn't work,
but changing it to 'open' works just fine.

I also threw in a '-w' to get more checking on the code, and Perl suggested
a few other minor changes. I added some comments, which needn't keep my
initials in them, but do keep that nifty 1-liner for the command line
handy, and I added a bit of checking/complaining if the user calls it
without an input file to parse. My diffs are below.=20

I've been eyes-deep in Nagios for a week or so, with some ramping up over
the past few weeks. I've actually had my eye on it since way back in
the early 'NetSaint' days. At that point, I was working for a
Networking/Security Consulting firm doing large Micromuse Netcool
installations for a bunch of (now extinct) ISPs with some seriously massive
networks.=20

Even back in early 2001, NetSaint looked pretty amazing, and it already did
some things that customers were asking us for (such as text-based alerts
that could go to WAP or an old monochrome terminal) and Netcool developers =
were
saying "No" to. (I think they were a bit too trapped by their own GUI.)

I'd been playing around with CVS builds over the last year, but didn't have
the time to devote to the thick & chewy docs, but I've just recently joined
a high-speed wireless ISP startup in the SF Bay area, and I suspect that
Nagios is going to play a great part in helping us.=20

I'm usually swamped with mail and slow with replies, so you may not hear
much from me, here. Or you might. I don't really know, yet. But I wanted to
at least notify folks so the FAQ could be corrected and the code would work
for others. (Might want to just link to a plaintext version of the file,
rather than including it in the HTML doc. I dunno...)

Anyway, You've got a new member of the Nagios family, and I wanted to thank
you all for the great work! It's really a fantastic product, even if it
*is* a bitch to learn at first. (Netcool was no better.) I actually think
your docs and examples are very well done, and you don't seem to require a
training class to even get started...just some perserverance.=20


I'm off to learn some more... :-)


Pat
___________________Think For Yourself____________________
Patrick G. Salsbury - http://reality.sculptors.com/~salsbury/
Contribute to the "Laws We'd Like To See" project:
http://reality.sculptors.com/cgi-bin/fom
---------------------------------------------------------
The Internet...it's not just for porn anymore. ;^)


Here's my diff:
>diff -u3 convert-nagios-logtime.pl.old convert-nagios-logtime.pl



--- convert-nagios-logtime.pl.old 2003-09-18 19:54:47.000000000 -0700
+++ convert-nagios-logtime.pl 2003-09-18 18:01:17.000000000 -0700
@@ -1,19 +1,28 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
+
+# Convert Nagios timestamps into human-readable format. - PGS 09-18-03
+# From the FAQ at:=20
+# http://www.nagios.org/faqs/viewfaq.php? ... e&showdes=
c=3Dtrue
+#
+# Alternatively, if you want to display the log from t

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked