Hi,
I have a nagios setup which is monitoring windows and Linux machines. What I don't quite understand is how to define a plugin. My Nagios is running on Ubunutu.I have setup the check_smtp plugin and it works, but I need to know how to define it more specifically.
What I do understand:
All plugins are in /usr/lib/nagios/plugins and /usr/local/nagios/libexec
you can test a plugin by running commands in that directory for example: check_smtp -H 10.0.0.189 -p 25
You setup you objects (hosts) in /usr/local/nagios/etc/objects. I have a .cfg for each host and once setup I add it in //usr/local/nagios/etc/nagios.cfg under the correct "definitions for monitoring a xxx machine"
check_smtp is defined in /usr/local/nagios/objects/commands.cfg: define command { command name...
What I don't understand
How do I define my check_smtp to go look on port 50. I know smtp doesnt run over port 50 but if I wanted to, how to I set it. Nowhere is there a check_smtp.cfg so nagios always assumes the defaults, but how do I define the switches for my nagios as in the help file:
Usage:
check_smtp -H host [-p port] [-4|-6] [-e expect] [-C command] [-R response] [-f from addr]
[-A authtype -U authuser -P authpass] [-w warn] [-c crit] [-t timeout] [-q]
[-F fqdn] [-S] [-D warn days cert expire[,crit days cert expire]] [-v]
In the commands is says: command line $user1$/check_smtp -H $HOSTADDRESS$ $ARG1$.
So where can I stipulate check_smtp $HOSTADDRESS$ -p50 -w3 -c5
Thank you.
Define plugins - help
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Define plugins - help
That would be in your service definition.
This is the documentation you need: http://nagios.sourceforge.net/docs/nagi ... tions.html
You would create a service something like:
The thing to note in that service definition is that $ARG1$, $ARG2$, etc are seperated by exclamation points (!) but it's not entirely necessary to specify more than 1 ARG - you can put all of your arguments (to be passed to the plguin) in 1 ARG1 (in the service definition).
This is the documentation you need: http://nagios.sourceforge.net/docs/nagi ... tions.html
You would create a service something like:
Code: Select all
define service {
host_name mailhost
service_description SMTP
use generic-service
check_command check_smtp!-p 50
register 1
}Re: Define plugins - help
Hi, This is a bit late but you can close this, I now understand the "waterfall" of Nagios.
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Define plugins - help
Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!