Script to monitor /var/opt/resmon/log/event.log file

AM in need of some plugin/script that can monitor HP-UX file "/var/opt/resmon/log/event.log" .

Have written a scrip in sh shell that is working fine for syslog.log and mail.log as having standard format, have interrogated that to Nagios and is working as I required .
But same script failed to monitor event.log file as this file having ambiguous log file format ..like normal dmesg with lot of blank lines .with lot of spaces ...etc..

---
    Event Id............: 0x4cd1a2d900000000
     Monitor Version.....: B.01.00
     Event Class.........: I/O
     Client Configuration File...........:
     /var/stm/config/tools/monitor/default_disk_em.clcfg
     Client Configuration File Version...: A.01.00
          Qualification criteria met.
               Number of events..: 1
     Associated OS error log entry id(s):
          None
     Additional System Data:
          System Model Number.............: 9000/861
          OS Version......................: B.11.00
          STM Version.....................: A.38.00
          EMS Version.....................: A.03.20
     Latest information on this event:
          http://docs.hp.com/hpux/content/hardware/ems/disk_em.htm#101

v-v-v-v-v-v-v-v-v-v-v-v-v    D  E  T  A  I  L  S    v-v-v-v-v-v-v-v-v-v-v-v-v



Component Data:
     Physical Device Path...: 8/4.5.0
     Device Class...........: Disk
     Inquiry Vendor ID......: SEAGATE
     Inquiry Product ID.....: ST39175LC
----------

If anyone have done this please suggest me the suitable plugin that I can use to monitor this file via Nagios .

--Shirish Shukla

Anything worth monitoring in /var/opt/resmon/log/event.log would appear as an EMS error in /var/adm/syslog/syslog.log .

You will probably need a basic script to process an EMS error line found in syslog.log and execute the suggested resmon command .. .which will actually display the same message as you would find in /var/opt/resmon/log/event.log .

Thanks a lot Methyl !!

Was not aware of this .. will check if is it ..

--Shirish

Here's a sample. I've just checked that executing the command suggested produces the same output as in the other log. However if the EMS alert is out of date (i.e. probably repaired) the command produces the message "There is no active monitor request for the resource".

Feb 15 03:03:00 servername EMS [4044]: ------ EMS Event Notification ------   Value: "SERIOUS (4)" for Resource: "/system/events/core_hw/core_hw"     (Threshold:  >= " 3")    Execute the following command to obtain event details:   /opt/resmon/bin/resdata -R 265029435 -r /system/events/cor_hw/core_hw -n 265027588 -a 

There can be a lot of trivia in /var/opt/resmon/log/event.log which would not normally appear in syslog.log. Messages like recovered disc errors and tape changes.