I suspect you are measuring the disk usage of the Icinga server and not of the
object server@domain.com.
You’ll probably find that this applies to all your other service checks too,
unless you have command_endpoint defined for those, and you just missed it out
of this one for some reason…
You need to have “command_endpoint = host.name” in order to run the checks on
the host itself.
Hello Again , Thanks for replying
So i should make in my service.conf
apply Service "disk" {
check_command = "disk"
// Specify the remote agent as command execution endpoint, fetch the host custom variable
command_endpoint = host.name.domain.com
// Only assign where a host is marked as agent endpoint
assign where host.name == "name.domain.com"
}
is that right ? cause i tested it and it does not provide the right value
If the agent is already installed, the command endpoint has to be set to exactly the name of the endpoint.
Check the zones.conf and constants.conf file on the agent to see the name of the endpoint.
Also to improve readability please use backticks to encase code snippets.
Here is a FAQ/HowTo on posting
Hello everyone,
i have posted an issue about the check of disk for my remote hosts ( installed by agent) but the result i get is only for my master
for example i have used the monitoring of procs and disk but the result for my remote server are the same as my master server ( I’m using architecture of Master->client)
Here is an example in how i monitor procs :
host.conf ( exemple of node)
object Host “ssl3.domaine.com” {
import “generic-host”
address = “x.x.x.x”
check_command = “dummy”
vars.notification[“mail”] = {
groups = [ “icingaadmins” ]
users = [“icingaadmin”]
}
enable_notifications = true
vars.notification_type = “email”
}
Your question seems quite similar to this one.
Is there something wrong with the answers?
As already said:
It might be enough to just add
command_endpoint = host.name
to your service-definition. It says “execute this check at the host-object the service is assigned to”. So a host which gets this service assigned, executes this check locally.
Example
apply Service "your_awesome_service" {
...
command_endpoint = host.name
...
}
Thank you so much ,
But here i should re-configure the node wizard by making disable the inclusions of conf.d to yes ( my case is no ) cause when doing that and you are right i added the command this output comme out
Remote Icinga instance ‘ssl3.domaine.com’ is not connected to ‘icingamaster.domaine.com’
i think that i should making inclusion of conf.d to yes ?
Thank you so much
Hello Antony ,
Thank you for replying
yes i forgot to add it , but now, after moving the host.conf to /etc/icinga2/zone.d/master ( for service.conf also )
i cant get the disk value bcz of this error
Remote agent is not connected to the master
i should make YES to disable the inclusions of conf.d
Hey @log1c,
I saw that you closed the other topic, but I think we should just merge the two instead, as it is basically one discussion
Makes it a lot easier to follow, when you don’t have to switch tabs all the time
I spinned up a new icinga-master with a single host “ssl3.domaine.com” (don’t worry, just as an example - adapted from your config).
Here the relevant configuration parts to
check disk on the agent, not on the master and
connect agent and master.
The “address” (see below in the example) has to be changed
I assume:
that you still have your hosts.conf in /etc/icinga2/zones.d/master/
you have still included the other files than zones.conf under /etc/icinga2/conf.d/ (check if “include_recursive conf.d” is not commented out in the /etc/icinga2/icinga2.conf)
Here the relevant parts of the configs with paths. Other parts are missing and presented by dots (…)
The part on the icinga2 master
# File: /etc/icinga2/zones.d/master/hosts.conf
...
object Endpoint "ssl3.domaine.com" {
}
object Zone "ssl3.domaine.com" {
endpoints = [ "ssl3.domaine.com", ]
parent = "master"
}
object Host "ssl3.domaine.com" {
...
import "generic-host"
address = "<change to your ip or fqdn here, without braces>"
vars.disks["disk /"] = {
disk_partitions = "/"
}
...
}
# ------------------
# File: /etc/icinga2/conf.d/services.conf
...
apply Service for (disk => config in host.vars.disks) {
import "generic-service"
command_endpoint = host.name
check_command = "disk"
vars += config
}
...
The part on the agent
# This config-part will be generated by the "icinga2 node wizard"
# File: /etc/icinga2/zones.conf
...
object Endpoint "ssl3.domaine.com" {
}
object Zone "ssl3.domaine.com" {
endpoints = [ "ssl3.domaine.com" ]
parent = "master"
}
...
The name of the agent node has to match the name on the master-node to connect to it successfully.