KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Text file parsing question

 
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX
View previous topic :: View next topic  
Author Message
invisik



Joined: 15 Jan 2007
Posts: 34

PostPosted: Fri Apr 11, 2008 8:41 am    Post subject: Text file parsing question Reply with quote

Hi,

I'm using the Linux RMA on a SUSE 10 box with HostMonitor 7.10. I have one item to check /var/log/messages for the word "error" and another item to check it for the word "root".

Unfortunately, I have a process that runs every few hours that does log in remotely as root, does a few things, and then logs out. This generates alerts when I don't want it to.

I haven't found a way to exclude certain lines of text when parsing a text file. The alerts I'm getting are exactly the same each time--if I could say "Alert on anything except these strings" that would be perfect.

Is that possible? Thanks for any info...

-m
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Fri Apr 11, 2008 9:11 am    Post subject: Reply with quote

What test method do you use? Text Log? Then you may use "Look for expression" option of the test.
Quote from the manual
Quote:

Look for

string: with this option selected HostMonitor will check records in a log file for a specified string. If new record contains specified data, HostMonitor will change status of the test to "Bad"

expression: with this option selected HostMonitor will check log records using a boolean (logical) expression. Status of the test will be set to "Bad" when the text in the record satisfies the required conditions. In the expression you may use strings (must be concluded in quotes (') or double quotes (")); round brackets; logical operators "and", "or", "not".
For example: if you define expression like ('error' or 'warning') and not '16536', then HostMonitor will mark test as "Bad" when line in the log contains string 'error' or 'warning' and does not contain string '16536'

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Fri Apr 11, 2008 9:18 am    Post subject: Re: Text file parsing question Reply with quote

invisik wrote:
I haven't found a way to exclude certain lines of text when parsing a text file. The alerts I'm getting are exactly the same each time--if I could say "Alert on anything except these strings" that would be perfect.
In addition to Alex, I want to say that if you are using "Text Log" test method, you may use "Optional Status processing" feature: http://www.ks-soft.net/hostmon.eng/mframe.htm#tests.htm#usrstatusprocessing
For instance, you may enable "Use Normal status if" option with the following expression:
Code:
('%SuggestedSimpleStatus%'=='DOWN') and ('Some string you want to exclude' in '%Reply%')


Regards,
Max
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index