Sune T.,
you can call me mike, my full name is james michael, but everyone calls me me mike.

Lets look at the source for for how the regex is used :

In the source code ;Kernel/System/PostMaster/Filter/SystemMonitoring.pm
you will see that it parses the state from the mail.
# Try to get State, Host and Service from email subject
    my @SubjectLines = split /\n/, $Subject;
    for my $Line (@SubjectLines) {
        for (qw(State Host Service)) {
            if ( $Line =~ /$Self->{Config}->{ $_ . 'RegExp' }/ ) {
                $Self->{$_} = $1;

Then when the state is extracted, it is matched :
 if ( $Self->{State} =~ /$Self->{Config}->{CloseTicketRegExp}/ ) {
where the default regex is  CloseTicketRegExp => 'OK|UP'

Then the state of the ticket is stet to the state named, and specified by CloseActionState which defaults to  'closed successful',

So if you use 0, then you would have to have 0 in the subject of the mails. If you want to specify a different state, you need to set the name of that state in CloseActionState.

I hope this helps explain how the system monitoring is used. Let me know if you have any more questions.

mike

On Fri, Mar 23, 2012 at 7:35 PM, Sune T. Tougaard <stt@lyngsoesystems.com> wrote:

Thanks Mike/James,

 

However, ”0” is exactly what i’m looking for, to see if the host is up.

 

I have an “OTRSNumState” that can be either 0, 1, 2, 3, 4 or 5.

0 is meant to close, while the rest is meant to create a new (or append to existing) ticket.

Hmm, perhaps I could just try putting some other text there, instead of the 0. I control both systems, so I can put anything I like.

I’ll try that instead of looking for numbers.

 

Thanks for your input, makes me think again. J

 

--

/Sune T.

 

From: otrs-bounces@otrs.org [mailto:otrs-bounces@otrs.org] On Behalf Of James Michael DuPont
Sent: 23. marts 2012 15:09
To: User questions and discussions about OTRS.
Subject: Re: [otrs] SystemMonitoring regexp failure

 

Hi there,

According to your mail you have
> 'CloseTicketRegExp' => '0',

You are going to need some regex to match if the host is up.

For example, the standard is  :

    CloseTicketRegExp => 'OK|UP',

That means OK or UP will mark the server as back online.

See also the documentation, it names this as the default value.

Let me know if that helps,
mike

--

James Michael DuPont

Custom Engineering/Research & Development 

 

OTRS AG

Norsk-Data-Straße 1

D-61352 Bad Homburg

 

 

Geschäftssitz: Bad Homburg, Amtsgericht Bad Homburg, HRB 10751, USt-Nr.: DE256610065

Aufsichtsratsvorsitzender: Burchard Steinbild, Vorstand: André Mindermann (Vorsitzender), Christopher Kuhn

 


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



--
James Michael DuPont
Custom Engineering/Research & Development 
 
OTRS AG
Norsk-Data-Straße 1
D-61352 Bad Homburg

T: +49 (0) 9421 56818 0
F: +49 (0) 9421 56818 18
I: http://www.otrs.com/

Geschäftssitz: Bad Homburg, Amtsgericht Bad Homburg, HRB 10751, USt-Nr.: DE256610065
Aufsichtsratsvorsitzender: Burchard Steinbild, Vorstand: André Mindermann (Vorsitzender), Christopher Kuhn