NSClient Error – Could not get data for

December 18, 2009
Filed Under Nagios 

Nagios Logo I started receiving an error in Nagios that stated:  NSClient – Error: Could not get data for 10 perhaps we don’t collect data this far back?  I started researching the issue, and the obvious solutions weren’t working.NSClient Error

When troubleshooting errors with NSClient, the easiest (and quickest) way to resolve the issue is to enable logging.  You can do this by editing your nsc.ini file and uncommenting the file line:

;# LOG FILE
;# The file to print log statements to
file=NSC.log

Now, open services.msc and restart the NSClient service.

After you manually run another check (or wait until Nagios does it for you), you should get some valuable information in the nsc.log file.  In mine, I kept seeing:

error:modules\CheckSystem\PDHCollector.cpp:264: Failed to get CPU value: \Processor(_total)\% Processor Time: Failed to get mutex : (

I first verified that the cpu buffer size in the nsc.ini file was large enough.  The recommendation is to go a step higher than your highest check.  For example, if the biggest value you check for CPU is the last minute average, the recommendation is to set the buffer to 2m.  However, setting this value too high could cause memory or performance issues on the box.

Currently, I monitor the 10 minute average, 60 minute average and the 1440 minute average (or 1 day average).  What was confusing was that it was failing on the first query for the 10 minute average.

When I tried viewing the CPU in the performance monitor built into Windows, it too failed, which turned out to be the “ah-ha” moment.  I simply needed to rebuild the performance counters, and reset the nsclient service again.

Rebuilding the performance counters in Windows 2003 is pretty easy.  The command is:

lodctr /R

Microsoft offers a different approach to rebuilding the counters if you’re running Windows 2000 – HOWEVER – I did run this on a Win2k server, and found it resolved the problem as well.  So far, my servers have been reporting the correct CPU averages now for the past 2 days.  In the past, there wasn’t anything I could do to get them to work (even restarting the service).  I’m still not sure what caused the corruption, but rebuilding seems to be the solution.

Rating 5.00 out of 5

Comments

One Response to “NSClient Error – Could not get data for”

  1. Fabian on May 28th, 2011 12:42 am

    That did the trick!!!!!!!!!!
    Thanks Guys.

Leave a Reply




Recent Posts

Microsoft Outlook PST large file size and not compacting
Installing Asterisk on Ubuntu 10.10 as Voicemail for Avaya S8700/8300 (Part 2)
Preparing for Asterisk on Ubuntu 10.10 as Voicemail for Avaya S8700/8300 (Part 1)
Linux Updates from Command Line
NSClient Error – Could not get data for
Gmail Notifier not working
Windows cannot access the specified device
The remote server has been paused or is in the process of being started.
APPCMD – HTTP 503 – Service Unavailable Windows 2008
Firefox Address Bar Not Changing in Ubuntu
Running Internet Explorer on Ubuntu
Could not create a Disk Cache Sub-directory for the Application Pool.
Event ID 13 Source AutoEnrollment
VBScript to determine OS Version and Service Pack
Can’t find script engine VBScript
Blackberry automatically deleting messages
The version of the Active Directory schema of the source forest is not compatible with the version of Active Directory on this computer
Neat tip in WordPress
Utilizing the & symbol (ampersand) in Microsoft Access Labels
Firefox Plugins in Ubuntu not working – Java, Flash, etc
Failed to execute request because the App-Domain could not be created
How to uninstall Windows Messenger
Disassociating Word from Internet Explorer
The test form is only available for requests from the local machine
WordPress Plugin: Current Read Widget
Disable RSS feeds in WordPress
The Requested Theme Does Not Exist Error in WordPress
HP Printer gets ip address of 85.85.170.170
Error opening tftp://255.255.255.255
Set a Link Button as default on Enter press
Ajax + IE = Unknown runtime error
PNG Files Do Not Show Transparency in IE6
Automatically Log In To Ubuntu
Using wuauclt and known switches
Prompted to Install mimeclnt.msi when Using OWA
Nagios Service Check Timed Out
How to disable ETags in IIS6
Customizing the WordPress “Read More” link
Using Tasklist.exe to view running programs
How to create a Batch file to download FTP files
How to add an Expires Header in IIS
Blinking Amber Light on Dell Server
How to reset a Cisco 2924 enable password
Enabling HTTP Compression in IIS6
Common CDP (Cisco Discovery Protocol) Problems
Resetting MYSQL Root Password in Ubuntu