Increase timeout hpasm

icingaweb2
#1

Hey,

I’ve got a server when i use the remote check_hpasm plugin, I’ve got a timeout (because the commande take more than 60seconds : generally it’s take 60,05 seconds :pensive: )
I tryin to increase the timeout of the check_hpasm plugin directelly in /usr/lib64/nagios/plugins/check_hpasm to 90sec but it’s not working. I always have the timeout in the GUI icingaweb after 60sec

cat /usr/lib64/nagios/plugins/check_hpasm | grep timeout
license timeout)) {
timeout => 90,
spec => ‘timeout|t=i’,
help => “-t, --timeout=INTEGER\n Seconds before plugin times out (default: %s)”,
default => $DEFAULT{timeout},
my %DEFER_ARGS = map { $_ => 1 } qw(timeout verbose);
timeout => { default => $DEFAULT{timeout} },

Add attr to private _attr hash (except timeout)

$self->{timeout} = delete $attr{timeout};
usage => 'Usage: %s [ -v|–verbose ] [ -t ] '.
timeout => 90,
$plugin->opts->get(‘timeout’);
alarm($plugin->opts->get(‘timeout’));

I’ve checked this topic Check_hpasm timeout setting not working but I don’t need to create a command parameter there is a template I think (just can’t find it)
May be I need to do something else but I don’t know why

#2

60s is the default check command timeout of icinga2.

Add a timeout = 2m to your check command definition, to change the commands timeout to 2 minutes (example). Values in seconds are also supported.

#3

I add in my check services

apply Service “hardware HP” {
check_command = “hpasm”
vars.hpasm_community = “mycommunity”
vars.hpasm_protocol = “1”
vars.hpasm_timeout = “90”
max_check_attempts = 5
check_interval = 1h
retry_interval = 5m
assign where host.vars.hp_hardware == true && host.address
}

but it’s not working

#4

You need to add the parameter to the check command definition.

Are you using config files or the Icinga Director?

#5

Yup, I just find where the ITIL are under /usr/share/icinga2/include/plugins-contrib.d/hardware.conf and there isn’t a timeout definition :wink:
just add vars.hpasm_timeout = “$hpasm_timeout$” I’ll edit my post if it work

#6

I’m not sure if editing ITL definitions is a good idea.
They will probably be reverted on the next update anyway.

Try creating a new command that imports the existing “hpasm” one and add the timeout setting there:
e.g.

object CheckCommand "hpasm_new" {
    import "plugin-check-command"
    import "hpasm"

    timeout = 90s
}

The 60 second timeout you are seeing will be most likely from icinga2 and not the plugin script, if it is always at 60 seconds.

#7

You’re right !
Thanks you log1c for your help.