Cannot map "tcp" to protocol number - for http an


Hi all,

I am new to nagios and have configured it for two of my machines so far. The ping functionality works great but the service functionality seems to have a problem. I get error messages that say
"Cannot map “tcp” to protocol number " for all the servies I have configured. I assume this has something to do with looking up the service in the /etc/services file. I am using ldap to store all servic info and this is handled by nss_ldap. ie the nssswitch file. My other apps, like postfix, have no problem looking up the service numbers.

Has anyone had this probelm and does anyone know how to solvce it?


If the error stated “ftp” then I could understand the error. But why tcp? paste your services.cfg entry that is giving this error, please.


When you find an answer let me know also.
I have the same exact problem. From a command line i attempt to execute the check_tcp plugin and get “cannot Map tcp to protocol number” no matter what port I attempt to connect.
the operating system is Solaris 9, the plugins where compiled from scratch.
I would suspect its something how the plugin does the check
this also does not work with check_ftp, nor check_udp. :roll:
the services file has the ports listed.
the problem happens whether I try and hit a remote host Or the "localhost"
specifying IP or hostname results in same issue. :x
anyone have a clue whats happening?


I have a workaround





I think I know what is happening but not how to fix it. seems the header files for the code dont match that which is required by Solaris 9 in some fashion. the same exact plugins work in Fedora Core 2 without issue. I would bet (not much money) that its how the TCP calls are made to the system that is different than that of the Linux environment.
My workaround is a simple perl script this seemed to work on my Solaris 9 system. I have not tested the code with Solaris 10 but Its PERL so I would suspect it works.
FYI the distributed plugins also work in Solaris 8, Cant fathom what was changed between 9 and 8


My porblme turned out to be missing entries in the protocol branch on our ldap server. It wasnt a problem in the past as nsswitch used to fallback to /etc/protocol. We did a system upgrade and it seems that nsswitch config has changed to fail if an entry is not found in ldap. :frowning:

All fixed now.