I want to check a file for a certain pattern, so the LOG check seemed like the natural choice. I got it configured and started to see some red statuses come in for hosts where the pattern matched, but then about 35 minutes later, they all go green though nothing has changed on the client.
Looking at the msgs column on a host, I can see that the “Full log” is empty. Is this the expected behavior? The file I'm checking for patterns in is not really a log file and rarely changes. Maybe the test is designed to discard lines it's already processed after 30 minutes?
So is there a way to check something like a config file for invalid patterns? Do I need to write a custom script? Writing and distributing a custom test is not a big deal to me at all. What I dread is adding yet another column to the web view, which is why I was looking for a built-in test to use.
-- Rob McBroom <http://www.skurfer.com/>
In <09DBBCE3-BD10-4846-B8FE-776FB811EC93 at skurfer.com> Rob McBroom <mailinglist0 at skurfer.com> writes:
I want to check a file for a certain pattern, so the LOG check seemed = like the natural choice. I got it configured and started to see some red = statuses come in for hosts where the pattern matched, but then about 35 = minutes later, they all go green though nothing has changed on the = client.
Yep, that is how the logfile checking is designed. Only logentries made in the past 30 minutes are included in each scan (except when starting from scratch - that's why you saw the entries in the beginning, and then they disappeared after half an hour).
So is there a way to check something like a config file for invalid = patterns? Do I need to write a custom script? Writing and distributing a = custom test is not a big deal to me at all. What I dread is adding yet = another column to the web view, which is why I was looking for a = built-in test to use.
You could 'hack' it by removing that entry from the client's status file in ~xymonclient/tmp/logfetch.HOSTNAME.status (a "grep -v" works since it's a text file). Then it would always scan the entire file.
I have a better idea for how to do this: The client today can do a "linecount" report where it counts the number of lines matching a regex pattern in a file. But on the server side this is only used for a "data" message that can be used to track the size of a file in a graph - it doesn't generate any status, or affect the color of the "msgs" or "files" status. It would be fairly simple to be able to define a rule in hobbit-clients.cfg so the "files" status went red if the linecount exceeded some threshold - "1" in your case. But that needs some new code in the client-handler on the Xymon server.
Regards, Henrik
Rob McBroom <mailinglist0 at skurfer.com> writes: I want to check a file for a certain pattern,
How about using the 'file' check in client-local.cfg ? The 'grep -ils' returns only the filename:
Check for IP printers configured to use PPDS.
file:grep -ils "Language.*ppds" /cvsrx/admin/etc/IP*
Check for UPS problems
file:grep -ils "NO_STATUS_AVAILABLE" /cvsrx/admin/tools/UPS/log/last.ups.status
Then in in hobbit-clients.cfg add a rule using 'NOEXIST'
Check if UPS status file has 'NO_STATUS_AVAILABLE' -- means UPS
daemon is
not running; possibly due to no comms to UPS
FILE "%.*/cvsrx/admin/tools/UPS/log/last.ups.status" yellow NOEXIST GROUP=SysAdmin
Check for IP printers configured to use PPDS (should be PCL)
(Weekdays, 8:30-16:00) FILE "%.*/cvsrx/admin/etc/IP." RED NOEXIST GROUP=SysAdmin TIME=W:0830:1600
-----Original Message----- From: Henrik "StC8rner [mailto:henrik at hswn.dk] Sent: Thursday, September 23, 2010 8:38 AM To: xymon at xymon.com Subject: Re: [xymon] lifetime of msgs status
In <09DBBCE3-BD10-4846-B8FE-776FB811EC93 at skurfer.com> Rob McBroom <mailinglist0 at skurfer.com> writes:
I want to check a file for a certain pattern, so the LOG check seemed = like the natural choice. I got it configured and started to see some red = statuses come in for hosts where the pattern matched, but then about 35
minutes later, they all go green though nothing has changed on the = client.
Yep, that is how the logfile checking is designed. Only logentries made in the past 30 minutes are included in each scan (except when starting from scratch - that's why you saw the entries in the beginning, and then they disappeared after half an hour).
So is there a way to check something like a config file for invalid = patterns? Do I need to write a custom script? Writing and distributing a = custom test is not a big deal to me at all. What I dread is adding yet
another column to the web view, which is why I was looking for a = built-in test to use.
You could 'hack' it by removing that entry from the client's status file in ~xymonclient/tmp/logfetch.HOSTNAME.status (a "grep -v" works since it's a text file). Then it would always scan the entire file.
I have a better idea for how to do this: The client today can do a "linecount" report where it counts the number of lines matching a regex pattern in a file. But on the server side this is only used for a "data" message that can be used to track the size of a file in a graph - it doesn't generate any status, or affect the color of the "msgs" or "files" status. It would be fairly simple to be able to define a rule in hobbit-clients.cfg so the "files" status went red if the linecount exceeded some threshold - "1" in your case. But that needs some new code in the client-handler on the Xymon server.
Regards, Henrik
To unsubscribe from the xymon list, send an e-mail to xymon-unsubscribe at xymon.com
On Sep 23, 2010, at 10:21 AM, Brand, Thomas R. wrote:
How about using the 'file' check in client-local.cfg ?
I'll look into this. Thanks.
-- Rob McBroom <http://www.skurfer.com/>
participants (4)
-
henrik@hswn.dk
-
mailinglist0@skurfer.com
-
rob@skurfer.com
-
TRBrand@cvs.com