1 ## <a id="monitoring-remote-clients"></a> Monitoring Remote Clients
5 If the remote service is available using a network protocol and port,
6 and a [check plugin](#setting-up-check-plugins) is available, you don't
7 necessarily need a local client installed. Rather choose a plugin and
8 configure all parameters and thresholds. The [Icinga 2 Template Library](#itl)
9 already ships various examples.
11 ### Agent-based Checks
13 If the remote services are not directly accessible through the network, a
14 local agent installation exposing the results to check queries can
19 The SNMP daemon runs on the remote system and answers SNMP queries by plugin
20 binaries. The [Monitoring Plugins package](#setting-up-check-plugins) ships
21 the `check_snmp` plugin binary, but there are plenty of [existing plugins](#integrate-additional-plugins)
22 for specific use cases already around, for example monitoring Cisco routers.
24 The following example uses the [SNMP ITL](#itl-snmp) `CheckCommand` and just
25 overrides the `oid` custom attribute. A service is created for all hosts which
26 have the `community` custom attribute.
28 apply Service "uptime" {
29 import "generic-service"
31 templates = [ "generic-service" ]
32 check_command = "snmp"
33 vars.oid = "1.3.6.1.2.1.1.3.0"
35 assign where host.vars.community
40 Calling a plugin using the SSH protocol to execute a plugin on the remote server fetching
41 its return code and output. `check_by_ssh` is available in the [Monitoring Plugins package](#setting-up-check-plugins).
43 object CheckCommand "check_by_ssh_swap" {
44 import "plugin-check-command"
46 command = [ PluginDir + "/check_by_ssh",
49 "-C", "\"/usr/local/icinga/libexec/check_swap -w $warn$ -c $crit$\""
53 object Service "swap" {
54 import "generic-service"
56 host_name = "remote-ssh-host"
58 check_command = "check_by_ssh_swap"
67 [NRPE](http://docs.icinga.org/latest/en/nrpe.html) runs as daemon on the remote client including
68 the required plugins and command definitions.
69 Icinga 2 calls the `check_nrpe` plugin binary in order to query the configured command on the
72 The NRPE daemon uses its own configuration format in nrpe.cfg while `check_nrpe`
73 can be embedded into the Icinga 2 `CheckCommand` configuration syntax.
77 object CheckCommand "check_nrpe" {
78 import "plugin-check-command"
81 PluginDir + "/check_nrpe",
83 "-c", "$remote_nrpe_command$",
87 object Service "users" {
88 import "generic-service"
90 host_name = "remote-nrpe-host"
92 check_command = "check_nrpe"
93 vars.remote_nrpe_command = "check_users"
98 command[check_users]=/usr/local/icinga/libexec/check_users -w 5 -c 10
102 [NSClient++](http://nsclient.org) works on both Windows and Linux platforms and is well
103 known for its magnificent Windows support. There are alternatives like the WMI interface,
104 but using `NSClient++` will allow you to run local scripts similar to check plugins fetching
105 the required output and performance counters.
107 The NSClient++ agent uses its own configuration format while `check_nt`
108 can be embedded into the Icinga 2 `CheckCommand` configuration syntax.
112 object CheckCommand "check_nscp" {
113 import "plugin-check-command"
116 PluginDir + "/check_nt",
119 "-v", "$remote_nscp_command$",
128 "pass" = "supersecret"
132 object Service "users" {
133 import "generic-service"
135 host_name = "remote-windows-host"
137 check_command = "check_nscp"
140 remote_nscp_command = "USEDDISKSPACE"
147 For details on the `NSClient++` configuration please refer to the [official documentation](http://www.nsclient.org/nscp/wiki/doc/configuration/0.4.x).
151 > The format of the `NSClient++` configuration file has changed from 0.3.x to 0.4!
155 A dedicated Icinga 2 agent supporting all platforms and using the native
156 Icinga 2 communication protocol supported with SSL certificates, IPv4/IPv6
157 support, etc. is on the [development roadmap](https://dev.icinga.org/projects/i2?jump=issues).
158 Meanwhile remote checkers in a [Cluster](#cluster) setup could act as
159 immediate replacement, but without any local configuration - or pushing
160 their standalone configuration back to the master node including their check
163 ### Passive Check Results and SNMP Traps
167 > The host and service object configuration must be available on the Icinga 2
168 > server in order to process passive check results.
172 [NSCA-ng](http://www.nsca-ng.org) provides a client-server pair that allows the
173 remote sender to push check results into the Icinga 2 `ExternalCommandListener`
176 The [Icinga 2 Vagrant Demo VM](#vagrant) ships a demo integration and further samples.
180 SNMP Traps can be received and filtered by using [SNMPTT](http://snmptt.sourceforge.net/) and specific trap handlers
181 passing the check results to Icinga 2.