PxPlus User Forum

Twitter Twitter Twitter

Author Topic: How to PING Windows Systems and/switches Using PvxPlus  (Read 629 times)

nmartinez@bristolind.com

  • Silver Member
  • ***
  • Posts: 36
    • View Profile
How to PING Windows Systems and/switches Using PvxPlus
« on: April 03, 2023, 03:38:45 PM »
Hi all,
Does anyone know how to PING network devices using PvxPlus (latest version)?  We have used the following to see if a Windows server allows RDP, but this does not work on those servers which do not allow it..
We have used OPEN (chn, TIM=10, err=*next) "[tcp]IPaddress;tcp-portnum

Thank you!

Mike King

  • Diamond Member
  • *****
  • Posts: 3799
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: How to PING Windows Systems and/switches Using PvxPlus
« Reply #1 on: April 03, 2023, 03:52:55 PM »
The OS ping command is available on pretty much all platforms so you should be able to use that.

If however you want to see if you can RDP to a host you likely could try:

OPEN (hfn,tim=5,err=NoRDP) "[tcp]IPaddress;3389"

3389 is the standard RDP port.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

nmartinez@bristolind.com

  • Silver Member
  • ***
  • Posts: 36
    • View Profile
Re: How to PING Windows Systems and/switches Using PvxPlus
« Reply #2 on: April 03, 2023, 05:02:34 PM »
Hi Mike,
I was hoping to get some sample PVXPlus code showing how the ping command is executed via PXPlus and how to read results to determine if successful or not..
Thx!

Mike King

  • Diamond Member
  • *****
  • Posts: 3799
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: How to PING Windows Systems and/switches Using PvxPlus
« Reply #3 on: April 03, 2023, 05:18:59 PM »
What PING command are you referencing?

The only thing related to a PING command that PxPlus has is a built-in keep alive for WindX workstations.  It is basically a timer internal in the EXE that after the pre-determined interval causes the system to a dummy message to the workstation.  If the message is not acknowledged prior the next transmission we assume the connection is lost.

As for pinging servers to see if they are present, the standard IP setup is to send a packet of data to port 7 of a server which should in turn echo it back.  So basically an OPEN of the server port 7. use WRITE RECORD to send some data (generally around 32-64 bytes) followed by a READ RECORD which should receive back the data sent.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

nmartinez@bristolind.com

  • Silver Member
  • ***
  • Posts: 36
    • View Profile
Re: How to PING Windows Systems and/switches Using PvxPlus
« Reply #4 on: April 03, 2023, 05:35:24 PM »
Does this look ok?

0010 BEGIN
0020 OPEN (1,TIM=5,ERR=*NEXT)"[wdx][tcp]192.168.77.230;7"
0030 WRITE RECORD (1,KEY="CHECKING IF PING COMMAND WORKS")
0040 READ RECORD (1)A$
0050 PRINT A$

nmartinez@bristolind.com

  • Silver Member
  • ***
  • Posts: 36
    • View Profile
Re: How to PING Windows Systems and/switches Using PvxPlus
« Reply #5 on: April 03, 2023, 05:36:35 PM »
the goal of the sample code above is to ping server with IP address 192.168.77.230 and try go see if ping is able to get any responses from it...

Mike King

  • Diamond Member
  • *****
  • Posts: 3799
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: How to PING Windows Systems and/switches Using PvxPlus
« Reply #6 on: April 03, 2023, 07:25:13 PM »
You shouldn't use the KEY=...

0010 BEGIN
0020 OPEN (1,TIM=5,ERR=BAD_HOST)"[wdx][tcp]192.168.77.230;7"
0030 WRITE RECORD (1) "CHECKING IF PING COMMAND WORKS"
0040 READ RECORD (1)A$
0050 PRINT A$

And I assume you are trying to see if the workstation can connect to the host -- thus the [wdx] prefix.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

nmartinez@bristolind.com

  • Silver Member
  • ***
  • Posts: 36
    • View Profile
Re: How to PING Windows Systems and/switches Using PvxPlus
« Reply #7 on: April 03, 2023, 08:05:04 PM »

I am getting an error #14 when running the sample code.. I have attached a screenshot showing the code, error and ping from the command line from Windows computer I am using to ping the server with IP address 192.168.77.230..

Mike King

  • Diamond Member
  • *****
  • Posts: 3799
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: How to PING Windows Systems and/switches Using PvxPlus
« Reply #8 on: April 04, 2023, 10:01:21 AM »
That may be because the ECHO service is not running on the machine you are connecting to.

Here is a link to a discussion about using the ECHO service and the 'ping' command that may explain what you are seeing.
https://networkengineering.stackexchange.com/questions/37896/ping-port-number
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com