Page 2 of 2

Re: Alert if a process IS running, rather than if it isn't

Posted: Mon Aug 24, 2015 10:56 am
by jdalrymple
peterooney wrote:what was the significance of all the trailing exclamation marks on the check_command line
Just what I said, separates arguments.

In your case:

Code: Select all

$ARG1$='check_nt -v PROCSTATE -d SHOWALL -l "Notepad++.exe"'
$ARG2$=NULL
$ARG3$=NULL
etc.

Since all trailing args after $ARG1$ are NULL the extra ! characters have no significance to your command and could be omitted. Incidentally, and as a point of illustration, your command could be rewritten:

Code: Select all

        command_line    $USER1$/negate $USER1$/$ARG1$ $ARG2$ $ARG5$ $ARG2$ $ARG3$ $ARG4$ $ARG2$ $ARG5$
And the validity doesn't change. All of those args would be filled with nothing and the resulting command would be identical.

As for your posted config - I don't see any reason it wouldn't work at first glance. Have you tried it?

Re: Alert if a process IS running, rather than if it isn't

Posted: Tue Aug 25, 2015 4:03 am
by neworderfac33
Finally sorted!

It was all down to a typo - I'd missed the trailing $ after $HOSTADDRESS - that's all it was.

But, without everybody's assistance in the first place, I'd still be a million miles away, so thanks to all!

I just noticed jdalrymple's latest response (on page 2, where I've only just looked this morning - Doh!), so I can remove my trailing exclamation marks too!

Code: Select all

define service{
        use                     generic-service
        host_name               MN2SVWBDT001SD0, MN2SVWBDT001SU0
        #hostgroup_name         windows-servers
        service_description     Application - Notepad++ Version 2
        check_command           negatepr!check_nt -H $HOSTADDRESS$ -p 12489 -v PROCSTATE -d SHOWALL -l "Notepad++.exe"!!!!!!!
        }

Regards

Pete

Re: Alert if a process IS running, rather than if it isn't

Posted: Tue Aug 25, 2015 9:13 am
by hsmith
peterooney wrote:Finally sorted!

It was all down to a typo - I'd missed the trailing $ after $HOSTADDRESS - that's all it was.

But, without everybody's assistance in the first place, I'd still be a million miles away, so thanks to all!

I just noticed jdalrymple's latest response (on page 2, where I've only just looked this morning - Doh!), so I can remove my trailing exclamation marks too!

Code: Select all

define service{
        use                     generic-service
        host_name               MN2SVWBDT001SD0, MN2SVWBDT001SU0
        #hostgroup_name         windows-servers
        service_description     Application - Notepad++ Version 2
        check_command           negatepr!check_nt -H $HOSTADDRESS$ -p 12489 -v PROCSTATE -d SHOWALL -l "Notepad++.exe"!!!!!!!
        }

Regards

Pete
Awesome, glad this is working!

I am going to go ahead and lock the thread since it is resolved. Let us know if you have any more issues.