I’m sure this is very simple… but I can’t seem to find what I’m looking for. I really have 2 problems.
I can’t seem to figure out how vars.procs_warning and vars.procs_critical actually work under the hood. My intention is actually binary… if the service is running, we should be good “OK”… and if the service is not running, Icinga2 should alert “CRITICAL”. I’ve been messing around trying to figure out the right formula for a day and a half and finally decided it’s just best to ask
When I run the check directly on the target running as the nagios user (or as the root user), I get an accurate result… but when I run the test via Icingaweb2 I get a 0 back no matter what. It’s almost like the check isn’t even running on the remote host maybe?
Here are what I think are the most relevant configurations:
full disclosure, I posted the same question on monitoring-portal.org, which seems like a very similar site… I’m not 100% sure what the relationship between this site and that site are, but I just wanted to make sure my bases are covered.
As I already expected, your zone config is wrong. To help one this we would need more info about your setup e.g. master, satellite(s), agents and their zones.conf. You don’t use the director, right?
I have director installed, but I don’t use it as most tutorials available seem to be based on config files. My setup is currently 1 Icinga2 master and a few Linux boxes with the agent on it. I used this tutorial to get Icinga2 and Icingaweb2 installed --> https://www.howtoforge.com/how-to-install-icinga-2-monitoring-on-ubuntu-1804/
Below seem to be the relevant configs and files related to zones.
root@management01:/etc/icinga2# cat constants.conf
const PluginDir = "/usr/lib/nagios/plugins"
const ManubulonPluginDir = "/usr/lib/nagios/plugins"
const PluginContribDir = "/usr/lib/nagios/plugins"
const NodeName = "management01.fqdn.domain.net"
const ZoneName = "master"
const TicketSalt = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
root@management01:/etc/icinga2# cat icinga2.conf
include "constants.conf"
include "zones.conf"
include <itl>
include <plugins>
include <plugins-contrib>
include <manubulon>
include <windows-plugins>
include <nscp>
include "features-enabled/*.conf"
include_recursive "conf.d"
root@management01:/etc/icinga2# cat zones.conf
/*
* Generated by Icinga 2 node setup commands
* on 2019-12-27 04:16:47 +0000
*/
object Endpoint "management01.fqdn.domain.net" {
}
object Zone "master" {
endpoints = [ "management01.fqdn.domain.net" ]
}
object Zone "global-templates" {
global = true
}
object Zone "director-global" {
global = true
}
root@management01:/etc/icinga2/zones.d# ls -alhr
total 12K
-rw-r--r-- 1 root root 119 Oct 24 08:38 README
drwxr-x--- 8 nagios nagios 4.0K Jan 3 15:57 ..
drwxr-x--- 2 nagios nagios 4.0K Jan 3 02:09 .
As you can see, I haven’t setup or changed anything specific to zones… I think I’m trying to implement the “top down” configuration, but I don’t really have need for segmented zones or satellite nodes as far as I can tell. I have a small home lab (practicing skills for a corporate implementation at some point). I was trying to achieve all checks sourced from the master node (ping, http, etc…) with the exception of polling running services which would obviously need to be run from the agent. Now that I look, it actually looks like all my checks are returning the same value… which leads me to believe I’ve definitely skipped a step somewhere. Any help is appreciated… thanks
Checks like check_procs need to executed locally means at your agent. Every agent need its own zone (having master as its parent) and this is mssing in your setup.