Hi again,

is there a quick and easy way to test the settings maybe in debug mode or verbose mode? I still do not get the error solved…

Thank you for any help!!

Nico



Am 14.12.2012 um 14:18 schrieb Gerald Young <crythias@gmail.com>:

Yes, we could take a look at the source code. line 425 (after which comes the error message) refers to line 194, Interesting parts:

220 LINE:
221 for my $Line (@BodyLines) {
222
223 # Try to get State, Host and Service from email body
224 ELEMENT:
225 for my $Element (qw(State Host Service)) {
226
227 next ELEMENT if $AlreadyMatched{$Element};
228
229 my $Regex = $Self->{Config}->{ $Element . 'RegExp' };
230
231 if ( $Line =~ /$Regex/ ) {
232
233 # get the found element value
234 $Self->{$Element} = $1;
235
236 # remember that we found this element already
237 $AlreadyMatched{$Element} = 1;
238 }
239 }
240 }


On Fri, Dec 14, 2012 at 3:18 AM, Nico Hoffmann <nh@bacanol.de> wrote:
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@otrs.org [otrs-bounces@otrs.org]" im Auftrag von "Gerald Young [crythias@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@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@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) -> smtp:OK

Body: 
Notification for 5.9.55.176 (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:

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



---------------------------------------------------------------------
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

---------------------------------------------------------------------
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