0

i am looking solution how to ship the choosen log using nxlog shipper to logstash and send alert to nagios.

there is many log pattern in that file, i want to monitor this type of log like below :

2015-03-04 09:54:55.298 [178] Statistic SmscWorker_10 INCOMING SM from MSISDN 651111111111111 2015-03-04 09:54:55.328 [220] Statistic SmscWorker_16 SUBMIT SM to MSISDN 651111111111111 ReqId 1008688024 TN 232

how to filter this log using nxlog shipper and send alert from logstash to nagios. "INCOMING SM" and "SUBMIT SM" should be in the log every 5 minutes. if there is no "INCOMING SM" or "SUBMIT SM" in 5 minutes, the logstash send alert to Nagios maybe using "/var/lib/nagios3/rw/nagios.cmd" prefered if there is nrpd command

Please advice me how to make it.

Thank you very much.

user2253805
  • 51
  • 1
  • 1
  • 4

1 Answers1

0

You can do something like this in nxlog:

Exec if $raw_event =~ /<REGEXP>/ exec_async("/var/lib/nagios3/rw/nagios.cmd", "param...");
b0ti
  • 986
  • 1
  • 6
  • 13