How to make Indirect checks
-
- Posts: 142
- Joined: Fri Jan 16, 2015 5:22 am
How to make Indirect checks
Hi nagios team,
i want to monitor a company which got several windows machines and a windows server ,
so i get the idea that the windows server will make the direct checks and get me the informations from the other machines and then i get these checks to my nagios server in our company .
FYI i'm already monitoring another company but with direct checks and i think it costs much resources to our nagios server in our company and also the configuration files are so merged with host definitions
1-is it a good idea to do the indirect checks ?
2- How i gonna modify the NSC.ini file so the server can do the direct checks ?
thanks
i want to monitor a company which got several windows machines and a windows server ,
so i get the idea that the windows server will make the direct checks and get me the informations from the other machines and then i get these checks to my nagios server in our company .
FYI i'm already monitoring another company but with direct checks and i think it costs much resources to our nagios server in our company and also the configuration files are so merged with host definitions
1-is it a good idea to do the indirect checks ?
2- How i gonna modify the NSC.ini file so the server can do the direct checks ?
thanks
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: How to make Indirect checks
There's nothing wrong, you just need to make sure that windows server is always up.ziedmahjoub wrote:1-is it a good idea to do the indirect checks ?
Here's a guide I wrote that shows you how to do it (NOTE this is for NSClient++ 0.4.1.105):ziedmahjoub wrote:2- How i gonna modify the NSC.ini file so the server can do the direct checks ?
http://sites.box293.com/nagios/guides/n ... g/nsclient
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 142
- Joined: Fri Jan 16, 2015 5:22 am
Re: How to make Indirect checks
Host B and Host C must have NSClient++ 0.4.1 also ?
-
- Posts: 142
- Joined: Fri Jan 16, 2015 5:22 am
Re: How to make Indirect checks
why it doens't work with NSClient++ 0.3.9 ?
i can't do indirect checks with 0.3 NSClient++ ?
I installed the 0.4.1.105 version , but and i'm not familiar with the config file of the 0.4.1 version
i can't do indirect checks with 0.3 NSClient++ ?
I installed the 0.4.1.105 version , but and i'm not familiar with the config file of the 0.4.1 version
Re: How to make Indirect checks
Have you attempted this procedure with NSClient++ 0.3.9? What were your results? According to what I've read, there should be no problems performing this procedure on NSClient++ 0.3.9.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: How to make Indirect checks
I just tested this against NSClient 0.3.9 and it didn't work for me. But perhaps I haven't configured it correctly.ziedmahjoub wrote:Host B and Host C must have NSClient++ 0.4.1 also ?
I don't know and it's becoming increasingly harder to find information on 0.3.9. I know the developer just ignores support requests for it now.ziedmahjoub wrote:why it doens't work with NSClient++ 0.3.9 ?
Specifically, only Host B needs to be NSClient++ 0.4.1.
Here's an install guide and tips on how to configure it:ziedmahjoub wrote:I installed the 0.4.1.105 version , but and i'm not familiar with the config file of the 0.4.1 version
http://sites.box293.com/nagios/guides/n ... dows/0-4-x
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 142
- Joined: Fri Jan 16, 2015 5:22 am
Re: How to make Indirect checks
Hi all
thanks Box293 for the tutorial,
the checks are OK and work successfully with the check_nrpe command .
Now i want to see the state of the hosts in the nagios interface that i'm cheking them indirectly.
Any idea how can i do it ?
thanks a lot
thanks Box293 for the tutorial,
the checks are OK and work successfully with the check_nrpe command .
Now i want to see the state of the hosts in the nagios interface that i'm cheking them indirectly.
Any idea how can i do it ?
thanks a lot
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: How to make Indirect checks
To make the hosts appear as real hosts you'll have to create new host definitions for them.
In the new host definitions give them the name you want, but the address of the first-hop nsclient++ server.
The other thing you'll need to make a little hairy is the check_command. You'll use something like:
Then in your nsclient.ini You'll have something like this in the section [settings/external scripts/scripts]:
Then you can define all the services you're monitoring under that host instead of the first-hop host.
Make sense?
In the new host definitions give them the name you want, but the address of the first-hop nsclient++ server.
The other thing you'll need to make a little hairy is the check_command. You'll use something like:
Code: Select all
check_nrpe -H $HOSTADDRESS$ -c check_ping_2ndhop
Code: Select all
check_ping_2ndhop=scripts\check_ping.bat <IP of 2nd hop>
Make sense?
-
- Posts: 142
- Joined: Fri Jan 16, 2015 5:22 am
Re: How to make Indirect checks
thanks jdalrymple ,
it makes sense what you said , but i got 2 questions :
1- the new command definition will be like this ?
2- for this
thanks so much jdalrymple
it makes sense what you said , but i got 2 questions :
1- the new command definition will be like this ?
Code: Select all
# 'indirect-check' command definition
define command{
command_name indirect-check
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c <script_name>
}
the services are defined like in direct checks or what ?Then you can define all the services you're monitoring under that host instead of the first-hop host.
thanks so much jdalrymple
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: How to make Indirect checks
ziedmahjoub,
1) Your command definition looks correct. Don't forget this command is then applied to the host definition, not a service definition. Then your <script_name> would be the command that the nsclient++ server is executing to verify that the indirect host is alive, so like check_ping.bat.
2) All services have to be associated with a host, but it doesn't have to be the host in question. Your configuration will end up being a bit confusing, but the output in the Nagios window will be proper.
You can likely understand the confusion, but this is the way to make it look "proper" in the Nagios UI.
--edit--
Added some clarity to the code by fully defining commands.
1) Your command definition looks correct. Don't forget this command is then applied to the host definition, not a service definition. Then your <script_name> would be the command that the nsclient++ server is executing to verify that the indirect host is alive, so like check_ping.bat.
2) All services have to be associated with a host, but it doesn't have to be the host in question. Your configuration will end up being a bit confusing, but the output in the Nagios window will be proper.
Code: Select all
##################################################
|-------------| # |-----------| |---------| #
| Nagios | # | NSclient++| | Indirect| #
| Linux |-FW EXCEPT-| Windows | | Windows | #
| 192.168.0.1 | # | 10.1.1.1 | | 10.1.1.2| #
|-------------| # |-----------| |---------| #
##################################################
Code: Select all
define command{
command_name indirect_check_ping
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_ping.bat
}
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
define host{
host_name indirect
address 10.1.1.1
check_command inderect_check_ping
}
define service{
host_name indirect
service_description disk_usage
check_command check_nrpe!check_disk_indirect
}
You can likely understand the confusion, but this is the way to make it look "proper" in the Nagios UI.
--edit--
Added some clarity to the code by fully defining commands.