We've moved to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

Go to the Answer Hub

Nagios plugin return bad values

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Nagios plugin return bad values

Postby SandraLewisFrin » Fri Mar 11, 2022 3:53 am

I'm porting some nagios plugins to be executed using the by_ssh plugin, I don't have big issues, but I have this weird comportment with the check_load plugin, here is how I configured it:

object CheckCommand "check_load_by_ssh" {
import "by_ssh"
command = [ PluginDir + "/check_load" ]
arguments = {
"-w" = "$check_load_by_ssh_warn$"
"-c" = "$check_load_by_ssh_crit$"
"-r" = "$check_load_by_ssh_percpu$"
}
}
And in the services config:

apply Service "check_load_by_ssh" {
import "generic-service"
check_command = "check_load_by_ssh"
assign where (host.address || host.address6) && host.vars.os == "Linux" && host.name != NodeName
}
And in the host config I added:

vars.check_load_by_ssh_warn = "2,2,2"
vars.check_load_by_ssh_crit = "5,5,5"
vars.check_load_by_ssh_percpu = false
The plugin works fine, but never gives me the good load average.. It always return the values like when I use the -r argument. Executing it via cli I have this:

[url]/usr/lib/nagios/plugins/check_by_ssh -H 192.168.0.42 -C "/usr/lib/nagios/plugins/check_load -w 2,2,2 -c 5,5,5"
WARNING - load average: 1.50, 2.06, 2.36|load1=1.500;2.000;5.000;0; load5=2.060;2.000;5.000;0; load15=2.360;2.000;5.000;0;

/usr/lib/nagios/plugins/check_by_ssh -H 192.168.0.42 -C "/usr/lib/nagios/plugins/check_load -w 2,2,2 -c 5,5,5 -r"
OK - load average: 0.38, 0.52, 0.59|load1=0.375;2.000;5.000;0; load5=0.515;2.000;5.000;0; load15=0.590;2.000;5.000;0;
So, in Icinga, I have values like the 2nd cli, I tried to set vars.check_load_by_ssh_percpu = true but nothing omegle shagle changed.[/url]

Thanks in advance guys :)
SandraLewisFrin
 
Posts: 10
Joined: Fri Feb 18, 2022 4:44 am

Return to Community Support

Who is online

Users browsing this forum: Google [Bot] and 24 guests