Watch FTP and HTTP service
Watch FTP and HTTP service
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
Thanks for your guidance.
Paul
-
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Watch FTP and HTTP service
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.
Re: Watch FTP and HTTP service
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.
Re: Watch FTP and HTTP service
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
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
-
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Watch FTP and HTTP service
You would need to either quote the whole thing 'singly', or use \"backslashes\" to escape the quotes in your command_line for the service.
Re: Watch FTP and HTTP service
Thanks for the help.
the command definition is setup like this.
My define servervice looks like this.
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
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$
}
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"/>'
}
Thanks For your help.
Paul
Re: Watch FTP and HTTP service
In the define service try adding a space:
old
new
Code: Select all
check_TCP-p 8080
Code: Select all
check_TCP -p 8080
Re: Watch FTP and HTTP service
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
Thanks
Paul
Re: Watch FTP and HTTP service
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
-
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Watch FTP and HTTP service
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.