Nagios

Updated 11 September 2025

InstallationNew Custom Alert
Common Issues
libnsl not available

While running the command to check for the TCP connectivity, you can observe the following error:

The command to use for check is:

bash
/usr/lib64/nagios/plugins/check_tcp -H 10.14.38.200 -p 54112 -w 10 -c 20 -s 30

The error observed is:

Image from notes

That usually means the library exists, but it’s either not named libnsl.so.1 or not in the dynamic linker’s path.

  1. Locate the file:
bash
find /usr -name "libnsl.so*" 2>/dev/null

You may see something like:

bash
/usr/lib64/libnsl.so.2

If you don’t see libnsl.so.1, you’ll need to create a symlink.

bash
ln -s /usr/lib64/libnsl.so.2 /usr/lib64/libnsl.so.1

Now run:

bash
ldconfig

This tells the dynamic linker about the new symlink.

Image from notes

Why This happens:

  • Older binaries (like Nagios plugins) were compiled against libnsl.so.1
  • On modern distros (like CentOS Stream 8), only libnsl.so.2 is available
  • A symlink bridges that gap
Spotted a mistake or want something added? Send me a note.