Watch FTP and HTTP service

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
groyii
Posts: 6
Joined: Thu Apr 14, 2011 9:11 am

Watch FTP and HTTP service

Post by groyii »

While I have been able to watch running processes I would also like to add a "heartbeat" check. I am having a problem setting this up. I am also currently looking this up on other forums but think this would be the best place to ask.

Thanks for your guidance.

Paul
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Watch FTP and HTTP service

Post by tonyyarusso »

How exactly are you wanting to do this? If you just want to check that any port is open and responding you can use check_tcp. Many also have specific plugins, like check_http.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
groyii
Posts: 6
Joined: Thu Apr 14, 2011 9:11 am

Re: Watch FTP and HTTP service

Post by groyii »

Correct I have and FTP server running and I need to know when/if it fails. I don't allow anonymous logins so I need to have it check with a user name and password. Check TCP might work for what I want to do.
groyii
Posts: 6
Joined: Thu Apr 14, 2011 9:11 am

Re: Watch FTP and HTTP service

Post by groyii »

I now have the check_ftp running and it is working great. I now have a question about check_http.

The application I need to watch receives http post data like this,
<mmRequest command="ping" client="NexusTest 1.0" userData="hello"/>

The reply is this,
<mmReply command="ping" userData="hello" status="ok"/>

How can I set this up with quotes all ready in the string?

Thanks

Paul
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Watch FTP and HTTP service

Post by tonyyarusso »

You would need to either quote the whole thing 'singly', or use \"backslashes\" to escape the quotes in your command_line for the service.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
groyii
Posts: 6
Joined: Thu Apr 14, 2011 9:11 am

Re: Watch FTP and HTTP service

Post by groyii »

Thanks for the help.

the command definition is setup like this.

Code: Select all

# 'check_tcp' command definition
        define command{
        command_name    check_tcp
        command_line    $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
        }
My define servervice looks like this.

Code: Select all

define service{
        use                     generic-service
        host_name               NEXUS_SVR
        service_description     Nexus Responding
        check_command           check_TCP-p 8080 -s '<mmRequest command="ping" client="Nagios Server Check" userData="Nexus Server Alive"/>' -e '<mmReply command="ping" userData="Nexus Server Alive" status="ok"/>'
                    }
Once this is entered the check command is highlighted yellow and the equal sign after status is white and " "ok"/>' " is red. I did try the same line escaping the quotes but the same thing happens. When this runs i get the message "check_tcp: Port must be a positive integer ". I'm not sure what I am missing.

Thanks For your help.

Paul
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: Watch FTP and HTTP service

Post by rdedon »

In the define service try adding a space:

Code: Select all

check_TCP-p 8080 
old

Code: Select all

check_TCP -p 8080 
new
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
groyii
Posts: 6
Joined: Thu Apr 14, 2011 9:11 am

Re: Watch FTP and HTTP service

Post by groyii »

same thing, but I did find something. I broke down my check_command line. The problem happens when I use an "=" in the string. I tried to escape the "=" by using the back slash but that didn't work.

Thanks

Paul
groyii
Posts: 6
Joined: Thu Apr 14, 2011 9:11 am

Re: Watch FTP and HTTP service

Post by groyii »

groyii wrote:same thing, but I did find something. I broke down my check_command line. The problem happens when I use an "=" in the string. I tried to escape the "=" by using the back slash but that didn't work.

Anyone have any thoughts on this?

Thanks

Paul
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Watch FTP and HTTP service

Post by tonyyarusso »

I have no idea... With the single quotes around everything it should be fine. One thing you can do is trying running it directly on the command line (outside of Nagios) and see what happens.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
Locked