[otrs] system monitoring and multiple sources of alarms - regex

Nico Hoffmann nh at bacanol.de
Fri Dec 14 08:18:34 GMT 2012


Hi Gerald,

Thank you for your answer. I did test the values but unfortunately OTRS is not recognizing the settings correctly. I still get
Fri Dec 14 09:02:03 2012        notice  OTRS-otrs.PostMaster.pl-10      SystemMonitoring Mail: SystemMonitoring: Could not find host address and/or state in mail => Ignoring

Is there a way to dig deeper into that module for debugging?

Thank you and best regards,

Nico



Von: otrs-bounces at otrs.org [otrs-bounces at otrs.org]" im Auftrag von "Gerald Young [crythias at gmail.com]
Gesendet: Donnerstag, 13. Dezember 2012 19:44
An: User questions and discussions about OTRS.
Betreff: Re: [otrs] system monitoring and multiple sources of alarms - regex

(apologies for the dropped sentence at the end)

Why .+ instead of .*? + is one or more of the preceding. * is zero or more of the preceding.
The suggested examples are intended to be less greedy about what it finds. If you know it's going to be all contiguous capital letters, [A-Z]+ is a better limited result than .*
Or use \w+ equivalent to [A-Za-z0-9_]+


On Thu, Dec 13, 2012 at 1:36 PM, Gerald Young <crythias at gmail.com<mailto:crythias at gmail.com>> wrote:
Probably because your state isn't found in an appropriate regex.
Try these:

\s*Host:\s+(.*)\s*|Notification for [\d\.]+ \((.+)\)
\s*Service:\s+(.*)\s*|\s*==>\s(.+)\s<==
\s*State:\s+(\S+)|State is now:\s+([A-Z]+)


Host would be some sourt


On Thu, Dec 13, 2012 at 1:05 PM, Nico Hoffmann <nh at bacanol.de<mailto:nh at bacanol.de>> wrote:
Hello List,

I have a problem with System Monitoring in OTRS 3.1.11 and multiple sources of alarms. The one source is an Icinga instance and this is working as expected. The other instance is the Hetzner system monitoring available for all root servers, that sends a little bit other notifications like Icinga/Nagios. Here is an example of a notification:
----
Subject: Notification for 5.9.55.176 (irgendwas.bacanol.de<http://irgendwas.bacanol.de>) -> smtp:OK

Body:
Notification for 5.9.55.176 (irgendwas.bacanol.de<http://irgendwas.bacanol.de>):

==> SMTP <==
State is now:   OK       (17:19h 2012.12.13)
State before:   ERROR    (was 14 minutes)
Service params: port=25
Service uptime: 99.96%
Check output:
  >  smtp connection works
----
My regex is like the following:

FromAddressRegExp: alarmingaddress at bacanol.de<mailto:alarmingaddress at bacanol.de>|support at hetzner.de<mailto:support at hetzner.de>
HostRegExp: \s*Host:\s+(.*)\s*|^Notification.*\((.*)\)
ServiceRegExp: \s*Service:\s+(.*)\s*|\s*==>\s+(.*)<==\s*
StateRegExp: \s*State:\s+(\S+)

----

Do you have any idea why the system claims that "SystemMonitoring Mail: SystemMonitoring: Could not find host address and/or state in mail => Ignoring"?

I tried to test my regex with external sites and perl support, but OTRS seems to treat this maybe different?

Thank you and best regards,

Nico

---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.otrs.org/pipermail/otrs/attachments/20121214/65214f44/attachment.html>


More information about the otrs mailing list