Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
define service {
use generic-service
hostgroup_name access-points
servicegroups ap-status
service_description Get IP from MAC ADDRESS and Ping for AP Status
check_command check_mac!$_HOSTMACADDRESS$!$_HOSTPARENT_DNS$
}
Let us know if this worked for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
[1556222489.844414] [2048.1] [pid=14359] **** BEGIN MACRO PROCESSING ***********
[1556222489.844421] [2048.1] [pid=14359] Processing: '$_HOSTMACADDRESS$'
[1556222489.844428] [2048.1] [pid=14359] Done. Final output: 'a4:93:4c:c1:27:9f'
[1556222489.844432] [2048.1] [pid=14359] **** END MACRO PROCESSING *************
[1556222489.844437] [2048.1] [pid=14359] **** BEGIN MACRO PROCESSING ***********
[1556222489.844441] [2048.1] [pid=14359] Processing: '$_HOSTPARENT_DNS$'
[1556222489.844447] [2048.1] [pid=14359] Done. Final output: 'HS-402-3560-01-1517'
[1556222489.844470] [2048.1] [pid=14359] **** END MACRO PROCESSING *************
[1556222489.844474] [2048.1] [pid=14359] **** BEGIN MACRO PROCESSING ***********
[1556222489.844478] [2048.1] [pid=14359] Processing: '$USER1$/check_mac $ARG1$ $ARG2$'
[1556222489.844485] [2048.1] [pid=14359] Done. Final output: '/usr/local/nagios/libexec/check_mac a4:93:4c:c1:27:9f HS-402-3560-01-1517'
[1556222489.844490] [2048.1] [pid=14359] **** END MACRO PROCESSING *************
[1556222489.884200] [2048.1] [pid=14359] **** BEGIN MACRO PROCESSING ***********
[1556222489.884213] [2048.1] [pid=14359] Processing: '$_HOSTMACADDRESS$'
[1556222489.884223] [2048.1] [pid=14359] Done. Final output: 'a4:93:4c:b2:57:83'
[1556222489.884227] [2048.1] [pid=14359] **** END MACRO PROCESSING *************
[1556222489.884232] [2048.1] [pid=14359] **** BEGIN MACRO PROCESSING ***********
[1556222489.884236] [2048.1] [pid=14359] Processing: '$_HOSTPARENT_DNS$'
[1556222489.884242] [2048.1] [pid=14359] Done. Final output: 'ES-124B-2960X-01-132'
[1556222489.884246] [2048.1] [pid=14359] **** END MACRO PROCESSING *************
[1556222489.919445] [2048.1] [pid=14359] **** BEGIN MACRO PROCESSING ***********
[1556222489.919467] [2048.1] [pid=14359] Processing: '$USER1$/check_mac $ARG1$ $ARG2$'
[1556222489.919483] [2048.1] [pid=14359] Done. Final output: '/usr/local/nagios/libexec/check_mac '
[1556222489.919494] [2048.1] [pid=14359] **** END MACRO PROCESSING *************
[1556222489.927713] [2048.1] [pid=14359] **** BEGIN MACRO PROCESSING ***********
[1556222489.927740] [2048.1] [pid=14359] Processing: '$USER1$/check_mac $ARG1$ $ARG2$'
[1556222489.927752] [2048.1] [pid=14359] Done. Final output: '/usr/local/nagios/libexec/check_mac '
[1556222489.927758] [2048.1] [pid=14359] **** END MACRO PROCESSING *************
[1556222489.927816] [2048.1] [pid=14359] **** BEGIN MACRO PROCESSING ***********
[1556222489.927823] [2048.1] [pid=14359] Processing: '$USER1$/check_mac $ARG1$ $ARG2$'
[1556222489.927828] [2048.1] [pid=14359] Done. Final output: '/usr/local/nagios/libexec/check_mac '
[1556222489.927831] [2048.1] [pid=14359] **** END MACRO PROCESSING *************
[1556222489.939980] [2048.1] [pid=14359] **** BEGIN MACRO PROCESSING ***********
[1556222489.940013] [2048.1] [pid=14359] Processing: '$USER1$/check_mac $ARG1$ $ARG2$'
[1556222489.940026] [2048.1] [pid=14359] Done. Final output: '/usr/local/nagios/libexec/check_mac '
[1556222489.940032] [2048.1] [pid=14359] **** END MACRO PROCESSING *************
It appears that it works sometimes and not sometimes. What would cause the inconsistency? I have verified that the host definitions are complete for the ones missing data.
Lastly, these all reset fine from a HARD down state in the service section, but I am also using this for the host check command. They are all currently locked in a 10/10 HARD state. I can run them via CLI and, as mentioned, the service is running without error. How do I reset the host 10/10 HARD state so that they can show OK again?
I'd be curios to see what's in the /usr/local/nagios/var/objects.cache for the hosts and services with these checks to make sure that all the variables are getting set correctly. I'd also try removing the hosts and services and verify they're removed in the web ui before adding them back in.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Received the data and I think the problem here is that the host template doesn't use the ARG options when defining the command. Edit /usr/local/nagios/etc/objects/templates.cfg and change:
define host {
name generic-access-point ; The name of this host template
use generic-host ; Inherit default values from the generic-host template
check_period 24x7 ; By default, switches are monitored round the clock
check_interval 2 ; Switches are checked every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 10 ; Check each switch 10 times (max)
check_command check_mac ; Default command to check if access points are "alive"
notification_period 24x7 ; Send notifications at any time
# notification_interval 30 ; Resend notifications every 30 minutes
# notification_options d,r ; Only send notifications for specific host states
# contact_groups admins ; Notifications get sent to the admins by default
register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
}
define host {
name generic-access-point ; The name of this host template
use generic-host ; Inherit default values from the generic-host template
check_period 24x7 ; By default, switches are monitored round the clock
check_interval 2 ; Switches are checked every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 10 ; Check each switch 10 times (max)
check_command check_mac!$_HOSTMACADDRESS$!$_HOSTPARENT_DNS$ ; Default command to check if access points are "alive"
notification_period 24x7 ; Send notifications at any time
# notification_interval 30 ; Resend notifications every 30 minutes
# notification_options d,r ; Only send notifications for specific host states
# contact_groups admins ; Notifications get sent to the admins by default
register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
}
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.