Bobcares

Nagios 12489 connection refused – Let us fix it

by | Apr 24, 2020

Are you stuck with the Nagios error 12489 connection refused?

The connection refused error occurs due to port block or improper configuration of NSClient.

At Bobcares, we often get requests to fix Nagios errors as part of our Server Management Services.

Today, let’s have a look at the reasons for this error. We’ll also see how our Support Engineers fix this error.

 

Why does Nagios show the 12489 connection refused?

NSClient program is a simple monitoring daemon, that is used to collect, receive, and distribute data metrics to Nagios monitoring tool.

The default port used by check_nt and NSClient is port 12489. The connection problem usually occurs due to different reasons like,

  • Windows not listening on the port 12489 or blocked by the firewall.
  • Disabling NSClient server in the nsclient.ini file.
  • Disabling essential NSClient modules.

For instance, the error appears as follows.

Nagios 12489 connection refused

 

How we fix the Nagios error?

At Bobcares, we have more than a decade of expertise in managing servers, we see customers’ facing Nagios errors. Now, let’s see how our Support Engineers fix this error.

 

Open port 12489

Recently, one of the customers got the Nagios 12489 connection refused error. Usually, the error occurs if the Windows firewall blocks the port or if the NSClient service does not listen on port 12489.

So, on the Windows host, we run the command.

netstat -an | find "12489"

We found that the port was not listening. So that we opened the port 12489 in the server firewall.

We also ensured that the firewall is allowing inbound connections to port 12489 as well.

 

Enable NSClient server

The same error can also happen due to missed entries in the configuration file nsclient.ini.

The check_nt command uses the NSClientServer parameter in the NSCLient++ agent. However, it was disabled in the nsclient.ini file.

We then added the following entry in the nsclient.ini file under the ‘[/modules]‘ section.

; NSClientServer - A server that listens for incoming check_nt connection and processes incoming requests.
NSClientServer = 1

Then we saved the configuration file.

Finally, we restarted the NSClient++ agent on the server.

Thus the error was resolved.

 

Enable NSClient modules

Similarly, the absence of essential modules can result in this error.

One of our customers was trying to make NSClient++ to run on the XP box. The customer had configured nsc.ini file but the Windows don’t listen on the port 12489 and he was receiving the error.

So we checked configuration file nsc.ini. We found that there were no modules loaded.

Hence, we enabled the basic modules,

  • NSClientListener.dll: This module accepts incoming NSClient requests and listens on port 12489.
  • CheckSystem.dll: It handles checks like CPU load, process state, etc.
  • CheckDisk.dll: This handles disc size checks and file status.

We enabled those modules by uncommenting the corresponding entries in the configuration file.

Finally, we restarted the service.

 

Other configuration

In addition, we check for other configuration settings like ALLOWED HOST ADDRESSES, NSCLIENT PORT NUMBER, etc. We ensure that these parameters are correctly defined in the nsc.ini file.

 

[Need assistance in fixing Nagios errors? – We’ll help you.]

 

Conclusion

In short, we fix the Nagios 12489 connection refused error by opening port 12489, tweaking check_nt command, enabling NSClient modules, etc. Today, we saw how our Support Engineers fixed this error.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF