Monitor FTP without ICMP

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.
Locked
Cyber Saiyan
Posts: 14
Joined: Mon Jun 15, 2015 7:01 am

Monitor FTP without ICMP

Post by Cyber Saiyan »

I would like to monitor our sFTP server and was able to get the config running; BUT, the windows host is constantly showing HOST DOWN messages since the windows-server template is set to monitor ICMP by default.

How would I create a new template that does not monitor for PING but will let me monitor ICMP?

I am thinking it would be similar to this:

define host{
use win-no-ping ; Inherit default values from a template
host_name Server name ; The name we're giving to this host
alias server alias ; A longer name associated with the host
address xxx.xxx.xxx.xxx ; IP address of the host
}


Thanks for reading!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Monitor FTP without ICMP

Post by ssax »

If you want to use check_icmp:

Code: Select all

define command {
       command_name                             check-host-alive
       command_line                             $USER1$/check_icmp -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
}

Code: Select all

define host{
use win-no-ping ; Inherit default values from a template
host_name Server name ; The name we're giving to this host
check_command check-host-alive!0!"OK - dummy check"
alias server alias ; A longer name associated with the host
address xxx.xxx.xxx.xxx ; IP address of the host
---
I misread your question at first, I'm leaving this in here because I wrote it :)

If you just want it to always show up you could add check_dummy into your commands:

Code: Select all

define command{
command_name check_dummy
command_line $USER1$/check_dummy $ARG1$ $ARG2$
}

Code: Select all

define host{
use win-no-ping ; Inherit default values from a template
host_name Server name ; The name we're giving to this host
check_command check_dummy!0!"OK - dummy check"
alias server alias ; A longer name associated with the host
address xxx.xxx.xxx.xxx ; IP address of the host
}
Cyber Saiyan
Posts: 14
Joined: Mon Jun 15, 2015 7:01 am

Re: Monitor FTP without ICMP

Post by Cyber Saiyan »

Well, its working...

I would like to make up a very technical story about having to recompile the source tar from scratch and inserting custom code to save face,

BUT

I will just admit that when I saved the win-noping template, I did not save it as a .cfg file. ls -l just showed win-noping not win-noping.cfg.

I would like to mention that I added the following to /usr/local/nagios/etc/objects/commands.cfg:

# 'check_ftps' command definition
define command{
command_name check_ftps
command_line $USER1$/check_ftp -H name.ofmy.server -p port#
}


and defined the win-noping template as follows:

define host{
name win-noping ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
max_check_attempts 10
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
notification_period 24x7 ; Send host notifications at any time
check_command check_ftps
}

Added the lines to /usr/local/nagios/etc/nagios.cfg and tested pre-flight. Everything ok, restarted services and all is good.

Since the Check_Uptime is not defined in the template, but the ftps check IS, the host is shown as green instead of grey as many others have been reporting.


Please feel free to close the thread.
Locked