2005 Nov 28 2:24 PM
Hi all,
anybody knows if there is a function or an example code to make a ping to specific IP (not necessary to a server).
Regards,
2005 Nov 28 2:26 PM
2005 Nov 28 2:31 PM
2005 Nov 28 2:34 PM
I've tried but the function is empty and I try to execute but it do nothing, there is no place to specify the IP.
2005 Nov 28 2:37 PM
2005 Nov 28 2:41 PM
You have to create RFC destination and then try FM SCWB_RFC_PING
2005 Nov 28 2:35 PM
2005 Nov 28 2:46 PM
Is possible to make a ping without defining an rfc?my problem is that I only want to know if a printer (connected via LAN) is on.
2005 Nov 28 2:47 PM
2005 Nov 28 3:00 PM
It sounds like maybe you want to do this via an OS command on the Server. Look in transaction SM69. These are the allowed and configured OS commands. I checked on my systems (HP-UX and Windows) and I see PING and NIPING both configured and last changed by SAP (so it looks like these are delivered). They are also marked as ANY OS.
Have a look at the function moduel SXPG_COMMAND_EXECUTE to excute the command.
2005 Nov 28 2:48 PM
2005 Nov 28 3:17 PM
Thanks Thomas, I'm trying the function module with the commands but it give me an exception, commmand_not_found.
2005 Nov 28 3:45 PM
2005 Nov 28 3:49 PM
2005 Nov 28 3:57 PM
An interesting note here if you trying this on a Windows OS Server. On WebAS 640, the delivered Ping Command required parameter '-c 4'. This doesn't appear to be valid on the Windows OS version of Ping.
However I checked a 7.00 WebAS, and SAP has removed that parameter from the PING Command.
In order to get the PING command to work on 640, I had to copy it to ZPING and remove the parameter. Now it tests out fine.
2005 Nov 28 4:03 PM
I'm trying the test transaction, but it says: syntax error at line 1: ´(' unexpected, but I'm using the commands defined by SAP and I don't know what to do
Thank you
2005 Nov 28 4:31 PM
2005 Nov 28 5:54 PM
I had defined a command ZPING for the command ping without parameters and I try to execute it via SM49 with the IP in the additional parameters
2005 Nov 28 6:08 PM
2005 Nov 29 11:28 AM
Thank you Thomas, the problem persists, I defined another time the command but when I test it, it give me this failure:
Comando efectuado: & ping : : 199.5.83.13
Máquina destino: SATI06
sapxpg: executing "ping".
Remote Call Failed in O4PRTLIBC::spawn_ile
Errno = 2
FILE=as4execp.cpp - LINE=150
SharedLibCache Information:
Search Path:
/sapmnt/DAS/exe
*LIBL
/usr/sap/DAS/DVEBMGS00/work
/QOpenSys/usr/bin
/usr/ccs/bin
/QOpenSys/usr/bin/X11
/usr/sbin
/usr/sap/DAS/SYS/exe/run
.
/usr/bin
/usr/sap/DAS/SYS/exe/run
Load Cache:
O4PRTLIBC Loaded as /sapmnt/DAS/exe/O4PRTLIBC
Program output follows
Program output ends
sh: syntax error at line 1 : `(' unexpected
External program terminated with exit code 255
2005 Nov 29 2:18 PM
I just tried this on our HP-UX system as well. It didn't work at first (I got external command not found). It turns out our unix admins move the ping executable to different directory. I had to adjust the command in SAP to get it to work.
So first I would suggest that you try some of the other external commands and make sure your environment is setup right.
Second, I would get with your system admin and make sure that you can issue the ping command from the OS level of the server (and if there is anything special you need to do it - like on my system).