logmon - run command and generate one alarm that contains all output

book

Article ID: 127502

calendar_today

Updated On:

Products

DX Infrastructure Management NIMSOFT PROBES

Issue/Introduction

Customer needs to run a command and have all of the output of the command returned in a single alarm message.

Cause

- logmon configuration

Environment

- UIM 8.51 or higher
- logmon v4.00 or higher

Resolution

Listed below are some screen shots and the portion of a logmon config showing a sample profile that will run a command and generate a single alarm with all of the output from the command. You should be able to adjust it to your specific requirements. Note that for the logmon text block variable you will have to define a field separator such as either:

• New line which is specified as /n
• White space (just press the space bar to enter it)
• Carriage Return which is \r
• etc… I used a space and it worked fine

Sample alarm output (multiple lines)

 





 




 




 




 


 

Additional Information



logmon.cfg sample

<TestBlockAlarmMessage>
      active = yes
      interval = 1 min
      scanfile = cmd /C netstat -an|findstr "4800"
      fileencoding =
      scanmode = command
      alarm = yes
      qos = yes
      message = no
      subject =
      user =
      reccur_directory = no
      reccur_directory_level = 10
      resetFile = no
      initialfileptr = 2
      resumefileptr = 4
      command_timeout_active = yes
      command_timeout = 20
      command_severity = 2
      command_timeout_alarm = yes
      alarmFOpenFail = no
      clearFOpenFailRestart = no
      monitor_exit_code = No
      max_alarm_sev = 5
      max_alarms =
      max_alarm_msg =
      password =
      <formats>
         <test>
            active = yes
            start = *TCP*
            end = *UDP*
            lines = 0
         </test>
      </formats>
      <watchers>
         <test1>
            active = yes
            match = /[0-9A-Za-z]+/
            level = warning
            subsystemid =
            message =
            i18n_token =
            restrict = test
            expect = yes
            abort = no
            sendclear = no
            count = no
            separator =
            suppid =
            source =
            target =
            qos =
            runcommandonmatch = no
            alarm_on_first_match = no
            commandexecutable =
            commandarguments =
            pattern_threshold_severity = information
            pattern_threshold_message =
            timeout = 1
            pattern_threshold =
            expect_message = ${netstatoutput}
            expect_level =
            regexfromexternalfile = no
            patternfilepath =
            token =
            variable_threshold =
            variable_threshold_message =
            variable_threshold_severity = information
            variable_threshold_supp =
            <variables>
               <netstatoutput>
                  definition = *
               </netstatoutput>
            </variables>
         </test1>
      </watchers>
   </TestBlockAlarmMessage>
 

Attachments

1558689844802000127502_sktwi1f5rjvs16g2h.png get_app
1558689843019000127502_sktwi1f5rjvs16g2g.png get_app
1558689841274000127502_sktwi1f5rjvs16g2f.png get_app
1558689839424000127502_sktwi1f5rjvs16g2e.png get_app
1558689837662000127502_sktwi1f5rjvs16g2d.png get_app
1558689834652000127502_sktwi1f5rjvs16g2c.png get_app