Am I able to specify certain commands to use a specific DNS Server?
Here is an example object:
define host{
use generic-ps-tp ; Inherit default values from a template
host_name Vienna PS - 1 ; The name we're giving to this switch
alias Vienna PS - 1 ; A longer name associated with the switch
address cm-0003080B4005.pkb.cascable.net ; IP address of the switch
hostgroups ps-tp-75 ; Host groups this switch is associated with
}
# Define a template for switches that we can reuse
define host{
name generic-ps-tp ; 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 5 ; 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-host-alive ; Default command to check if routers are "alive"
notification_period 24x7 ; Send notifications at any time
notification_interval 30 ; Resend notifications every 30 minutes
notification_options ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
register 0 ; DONT REGISTER THIS - ITS JUST A TEMPLATE
}
I want them to use a different dns than the one specified in resolv.conf to run its tests, is this possible?
The error I receive when using my normal DNS is: getaddrinfo: cm-0003080B4005.pkb.cascable.net Name or service not known
(they are internal addresses so I need them to point to an internal machine for the results to come back correctly)
Specify DNS
Re: Specify DNS
What is the use case for this? The address in the config must resolve to run checks and resolv.conf is where the XI server will get its dns from. Have you considered using /etc/hosts ?brandonb110 wrote:I want them to use a different dns than the one specified in resolv.conf to run its tests, is this possible?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
brandonb110
- Posts: 7
- Joined: Thu Apr 25, 2013 9:10 am
Re: Specify DNS
Currently I am using our modem provisioning server as the DNS server for Nagios and everything is working correctly. The provisioning server is the only one that is able to ping cm-0003080B4005.pkb.cascable.net. I was tried using multiple DNS servers but the check_ping constantly flaps.
Re: Specify DNS
If that is the case, I presume that is why you are trying to do a TCP check instead of an ICMP check, correct? Can Nagios even reach that host then? Does it have a route? Can you set up resolv.conf to use the provisioning server as a secondary dns server?brandonb110 wrote:The provisioning server is the only one that is able to ping cm-0003080B4005.pkb.cascable.net.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
brandonb110
- Posts: 7
- Joined: Thu Apr 25, 2013 9:10 am
Re: Specify DNS
Sorry I am not very familiar with the nagios application, the person who origiannly set it up is no longer with us so I just recently started getting my head in it. When I put the provisioning server in as the secondary it still fails the check. the cm-xxx address is not exaclty internal only- it resolves to an ip address but only the provisioning server is resolving it.
traceroute to cm-000bc90ad9a8.pkb.cascable.net (10.10.118.206), 30 hops max, 60 byte packets
1 cas-wv-cpe-216-20-129-1.cascable.net (216.20.129.1) 0.797 ms 1.013 ms 1.0 59 ms
2 cas-wv-cpe-216-20-128-2.cascable.net (216.20.128.2) 0.299 ms 0.348 ms 0.3 53 ms
3 * * *
4 10.10.118.206 (10.10.118.206) 21.656 ms 21.678 ms 20.215 ms
I can resolve the issue by changing all of the addresses to the actual IP address but they are not static addresses so would be needing to change them every so often.
traceroute to cm-000bc90ad9a8.pkb.cascable.net (10.10.118.206), 30 hops max, 60 byte packets
1 cas-wv-cpe-216-20-129-1.cascable.net (216.20.129.1) 0.797 ms 1.013 ms 1.0 59 ms
2 cas-wv-cpe-216-20-128-2.cascable.net (216.20.128.2) 0.299 ms 0.348 ms 0.3 53 ms
3 * * *
4 10.10.118.206 (10.10.118.206) 21.656 ms 21.678 ms 20.215 ms
I can resolve the issue by changing all of the addresses to the actual IP address but they are not static addresses so would be needing to change them every so often.
Re: Specify DNS
The nagios server will need to be able to lookup the names. Have you tried setting the provisioning server as the dns server for the XI box in /etc/resolv.conf?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
brandonb110
- Posts: 7
- Joined: Thu Apr 25, 2013 9:10 am
Re: Specify DNS
Yes I have made the provisioning server the primary server in resolv.conf but ever since I did that occasionally the provisioning server dns service is restarting automatically about twice a day, thats why I am trying to look for a workaround.
Re: Specify DNS
Well, as only one dns server exists in your environment for these hosts, there may not be an easy work around other than adding a second dns server that can process lookup requests for those hosts.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.