Page 1 of 2

check_hpasm incorrect results

Posted: Mon Aug 11, 2014 3:30 am
by JulianD
Hello,

check_hapasm reporting nagios server information rather than requested server information

[root@nagios]# ./check_hpasm -H sqlserver -C public-snmp
OK - System: 'proliant dl380 g5', S/N: 'CZC6425STZT', ROM: 'P56 01/24/2008', hardware working fine, da: 1 logical drives, 7 physical drives | fan_1=50% fan_10=50% fan_11=50% fan_12=50% fan_2=50% fan_3=50% fan_4=50% fan_5=50% fan_6=50% fan_7=50% fan_8=50% fan_9=50% temp_1_ioBoard=45;70;70 temp_2_ambient=23;39;39 temp_3_cpu=32;127;127 temp_4_cpu=32;127;127 temp_5_powerSupply=44;77;77

But on the nagios webpage:

OK - System: 'proliant dl360 g7', S/N: 'CZJ03704D28', ROM: 'P68 01/28/2011', hardware working fine, da: 1 logical drives, 4 physical drives

The first from the commnad line is correct for the sqlserver but the second is information from the nagios server itself!
Where is the nagios server incorrectly reading itself rather than the address of the server I want information from?

define command {
command_name nrpe_check_hpasm
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_hpasm -t 60
}


define service {
use generic-service
hostgroup_name tec-Windows-Hardware
service_description SYS - Hardware
contact_groups Notify-Intern
check_period 24x7
notification_interval 60
notification_options w,u,c,r
notification_period 24x7
check_command check_hpasm
max_check_attempts 3
normal_check_interval 60
retry_check_interval 1
}
define host {
use generic-host
host_name SQLSERVER
alias SQLSERVER
address 10.100.8.39
parents FRONT
check_command check-host-alive
max_check_attempts 3
notification_interval 60
notification_period 24x7
notification_options d,u,r
contact_groups Notify-Intern
}
I see this as a nagios problem as it works from the command prompt.

Any help would be appreciated, thank you,


JulianD

Re: check_hpasm incorrect results

Posted: Mon Aug 11, 2014 8:01 pm
by Box293
I think you are querying two different servers:

This command is querying the DNS address sqlserver
JulianD wrote:[root@nagios]# ./check_hpasm -H sqlserver -C public-snmp
Your host definition is querying the host 10.100.8.39
JulianD wrote:define host {
use generic-host
host_name SQLSERVER
alias SQLSERVER
address 10.100.8.39
What ip address do you get when you ping sqlserver

Re: check_hpasm incorrect results

Posted: Tue Aug 12, 2014 1:15 am
by JulianD
Hello,

Apologies, I copy and pasted too fast as when I first wrote post I lost it after being asked for password.

The qoute should be

define host {
use generic-host
host_name SQLSERVER
alias SQLSERVER
address 10.100.8.6
parents FRONT
check_command check-host-alive
max_check_attempts 3
notification_interval 60
notification_period 24x7
notification_options d,u,r
contact_groups Notify-Intern
}

I didn't check the ip address when copying. Sorry about that. co worker then though that it could be dns but impossible as this is a production server for a large customer.

Thanks for your assistence,

JulianD

Re: check_hpasm incorrect results

Posted: Tue Aug 12, 2014 9:26 pm
by Box293
No problems.

I think the core of the problem is that you're trying to use NRPE for an SNMP based check.

NRPE is for executing checks on remote systems when the required check needs to be run (directly) on the remote system.

The example you've provided for check_hpasm shows that it can connect to a remote server using SNMP, so there's no need to use NRPE.

Your command needs to be defined as follows:

Code: Select all

define command {
command_name check_hpasm
command_line $USER1$/check_hpasm -H $HOSTADDRESS$ -C $ARG1$
}
And in your service definition:

Code: Select all

check_command check_hpasm!public-snmp
Does that work?

Re: check_hpasm incorrect results

Posted: Wed Aug 13, 2014 1:49 am
by JulianD
Hello again, and thanks for the help,

It would be nice if I had to sense check before I uploaded this the first time. Second mistake now shown up.

define command {
command_name check_hpasm
command_line $USER1$/check_hpasm $HOSTADDRESS$ -C $ARG1$

}

is the correct lines from the commands.cfg for the query.

So if I wrote my first post right the first time it would have had the following
from hosts.cfg...
define host {
use generic-host
host_name SQLSERVER
alias SQL
address 10.100.8.6
parents FRONT
check_command check-host-alive
max_check_attempts 3
notification_interval 60
notification_period 24x7
notification_options d,u,r
contact_groups Notify-Intern
}

from services.cfg...

define service {
use generic-service
hostgroup_name tec-Windows-Hardware
service_description SYS - Hardware
contact_groups Notify-Intern
check_period 24x7
notification_interval 60
notification_options w,u,c,r
notification_period 24x7
check_command check_hpasm
max_check_attempts 3
normal_check_interval 60
retry_check_interval 1
}


So this sqlserver is in a hostgroup with 54 other window servers. All the server show the result

OK - System: 'proliant dl360 g7', S/N: 'CZJ03704D8', ROM: 'P68 01/28/2011', hardware working fine, da: 1 logical drives, 4 physical drives

instead of their own.

What is this CZJ03704D8? It's the nagios server! But as I said this makes no sense to me as the check should run on each and every server.

Thanks!

Re: check_hpasm incorrect results

Posted: Wed Aug 13, 2014 2:13 am
by Box293
No problems, so is this working now for all 54 servers?

Re: check_hpasm incorrect results

Posted: Wed Aug 13, 2014 11:17 am
by JulianD
No,

it is doing what I really don't need. Providing information from the nagios server rather than each server.

I cannot see where to look

thanks

JulianD

Re: check_hpasm incorrect results

Posted: Wed Aug 13, 2014 4:15 pm
by Box293
JulianD wrote:define service {
use generic-service
hostgroup_name tec-Windows-Hardware
service_description SYS - Hardware
contact_groups Notify-Intern
check_period 24x7
notification_interval 60
notification_options w,u,c,r
notification_period 24x7
check_command check_hpasm
max_check_attempts 3
normal_check_interval 60
retry_check_interval 1
}
check_command needs to be:

Code: Select all

check_command check_hpasm!public-snmp

Re: check_hpasm incorrect results

Posted: Thu Aug 14, 2014 5:43 am
by JulianD
Hello,

Thank you. Change made bt I still get the information for the nagios server rather than server requested.

thanks

JulianD

Re: check_hpasm incorrect results

Posted: Thu Aug 14, 2014 5:55 am
by Box293
Can you post a link to where you downloaded the plugin from.