Using Google Chrome?

Download my
free Chrome Extension, Power Notes Searcher, to make searching for and evaluating SAP notes, much easier.

Recent Posts

Thursday, January 02, 2014

Network Port Test Using SAP NIPING

Print Friendly and PDF
Some companies have additional security policies that remove the Telnet application from the local desktop PCs.
This can prove difficult for SAP BASIS people trying to test if a specific network port is reachable, since Telnet is a perfect way of testing if a server port is accessible, or being blocked by a firewall.
Instead, you can use the NIPING tool (Network Interface Ping) supplied with the SAP Frontend installation on the desktop PC.

Check if you have NIPING.exe, it should exist in the default install location: "C:\Program Files\SAP\FrontEnd\SAPgui\".

You have to call NIPING from a command prompt:

C:> cd C:\Program Files\SAP\FrontEnd\SAPgui\

There are two command line options that are useful when calling NIPING.
The command line option "-R" tells NIPING to attempt a RAW TCP connection.
Option "-P" specifies that NIPING should option slightly more detail.

If you need to test if a network port is available, you need to use the RAW option.
You don't care what transport layer protocol is required (SMTP, HTTP, Telnet, SSH), you just want it to try and open a bare TCP connection to the specified port and see what happens.

To use NIPING with the RAW option:

> niping -c -H <dest host>  -S <dest port>  -R  -P

You will get some fairly detailed output.
What you are looking for is a return code (RC) of "-6" and "ERROR connection to partner '' broken".

The RC of "-6" indicates that NIPING was able to open the TCP connection (NIPCONNECT) successfully, but it was not able to receive (NILREAD)  because the server closed the connection when we didn't send any information (it was a raw connection).

If you receive an RC of "-10" and "ERROR partner not reached" this indicates that NIPING was not able to even establish a basic TCP connection (NIPCONNECT) to the server host and port.
You may not have an network route to the server, the server IP may be invalid, the port may not be listening on the server, a firewall may be blocking you and many other reasons.

If you are simply trying to connect to a known SAP system dispatcher port (for SAP GUI connections), then using NIPING without the RAW option will perform an RFC connection to the SAP system dispatcher, if possible:

> niping -c -H <dest host>  -S 32<SAP_sys_id>

When you use NIPING without the RAW option, it will return success ("Connect to server o.k.") if it can successfully connect to the SAP system dispatcher.  It will always complain about "bytes_written <> bytes_read", so ignore this error.

You should note that connecting to the SAP ABAP message server (36xx) will return a "ERROR connection to partner broken" and RC "-6" (just like a RAW connection) if it was successful.
The reason is that this is not a straight RFC connection that supports NIPING.  It's meant to hand-off to a specific dispatcher or other tasks, but not ping.

No comments: