TracNav menu
-
Home
-
Documentation
-
About
- Michael Medin (author)
- Installation
- Configuration
-
Usage
- Using with Nagios
- FAQ
-
Information
-
Tips & Tricks
-
RemoteUpdate via:
- VB/PSExec scripts
- .bat/.cmd scripts
- NRPE and AT
- SUBINACL
- Real world Configurations
- Build
- Support
-
Conferences
- Netways Nagios Konferenz 2008
- Sponsoring
-
Commands/Modules
- CheckDisk
- CheckEventLog
- CheckSystem
- [CheckTaskSched]
- CheckHelpers
- FileLogger
- NRPEListener
- NSClientListener
- SysTray
- CheckWMI
- RemoteConfiguration
- CheckExternalScripts
- LUAScript
- NSCAAgent
-
Donate
- …
Tips and Tricks
Monitoring Microsoft Clusters
If you wish to check the state of a clustered service on Windows 2000 or Windows 2003 (such as Microsoft SQL Server), you can do so using nsclient++. The main issue is that if you have a multiple node cluster, you do not know which one is active at any given time. If you monitor both nodes using Nagios, one will always be critical while the other is not. This is not a good situation. The cleanest solution is to cluster the NSClient++ daemon, so that it is always running on the active node. This is simple to do using the "Generic Application" Resource template in the Cluster Administrator. There are a few considerations.
- You may wish to monitor each node individually to ensure services such as the clustering service itself are running.
- You may additionally wish to monitor the ACTIVE node for clustered services (such as MSSQL or Exchange).
You can achieve this with the latest version (0.2.5h as of writing). You must install it using the following method.
Installing on a Node
- First, extract the archive to a folder (c:\nsclient).
- Install the service (c:\nsclient\nsclient++ /install).
- Configure the service to only listen on the machines's IP address, use the bind_to_address option for both the NRPE and NSClient listeners.
Repeat for all nodes in cluster.
Installing for Clustered Services.
- If you do not have any clustered physical disks in your service's resource group, create one.
- Copy the nsclient binaries and configuration from one of the nodes to the clustered physical disk (c:\nsclient\* -> d:\nsclient\) assuming D is your clustered physical disk.
- Modify the shared configuration file so that the bind_to_address matches the IP Address resource defined in your clustered service's group in the Cluster Administrator.
- Using the Cluster Administrator, create a new resource in the group that contains the clustered service you wish to monitor.
- Give the Resource a name like <service>_nsclient (each resource name must be unique within a cluster, so if you monitor multiple services, you will need to prepend the service name as shown).
- Use an appropriate description, and choose "Generic Application" as the resource type.
- On the next page, choose which nodes are possible owners (should match the service you wish to monitor).
- On the next page, make the resource depend on the IP Address resource that exists in the group.
- On the next page, specify the path to the nsclient++.exe on the clustered physical disk for the command line. MAKE SURE YOU USE THE /test ARGUMENT. nsclient++ will not actually start up unless you provide it the /test argument.
- Click finish.
- You can now utilize the IP Address specified by the IP Address resource in the resource group to monitor this service. You can be assured that the nsclient will be running on whatever node is active for the service in this group.
A note about linux locales ,check_nt and localized windows performance counters
If you've trouble getting the return value of a localized windows performance counter from a linux machine with check_nt, try changing the default locale. For example on a debian "etch" machine you would issue the following commands:
- run "dpkg-reconfigure locales" ,choose the locales you want to create and set a non UTF-8 version as the default locale ( for example de_DE@euro for a german locale with euro support )
- run "/etc/init.d/console-screen.sh restart"
- logout and login
Checking if a user is logged in
A nightly process requires us to make sure a specific account is logged on, here is the Nagios command to check if a user is logged on.
$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -n -c CheckWMI -a "Query=Select Antecedent from Win32_LoggedOnUser" MinCrit=0 +filter-string:Antecedent=substr:$ARG1$
