What Is CDiag (“Comprehensive Diagnosis Tool”)?

Many times, diagnosis of a file sharing / network problem starts with defining the scope of the problem. I find an 8 step process useful when analysing a problem between 2 computers.

From each computer:

  1. Ping itself by name.
  2. Ping itself by ip address.
  3. Net View itself by name.
  4. Net View itself by ip address.
  5. Ping the other by name.
  6. Ping the other by ip address.
  7. Net View the other by name.
  8. Net View the other by ip address.

So, whenever a problem was presented to me, I would copy and paste a standard set of instructions (similar to the 8 step process above) into a post to someone needing help.

This was a good start, but needed to be more sophisticated.

  • People needing help would not follow directions.
  • People needing help would mistype one or more commands.
  • People needing help did not know how to find out the ip address.
  • People needing help could not reliably copy the output from the 8 steps.
  • Sometimes, we had more than 2 computers involved.

Since I was already asking for the output from “ipconfig /all” many times, I found it easy to take relevant content from ipconfig, and copy and paste it into a macro. The macro had to be:

  • Text based.
    • Most forums where I provide assistance are text only (non-binaries) forums.
    • In keeping with my tag line, I would not download binary code from anyone, nor would I expect anyone to download binary code from me.
  • Small, and easily copied.
  • Carefully written, to not include any line breaks or other artifacts that would muck things up.
  • Use standard utilities “net view” and “ping”.

I did not get to this complete level of sophistication (if I’m there yet!) immediately. If you examine the CDiag Source, you’ll notice that it’s not at V1.00. It took several tweaks, and it will likely take several more.

CDiag has its limitations. It won’t run on Windows 9x (95 or 98), though I believe that it will run on ME. I haven’t developed a way to parse its output automatically, but I would surely like to. Error messages do not redirect into the log file, but are printed in the command window, leading to occasional confusion.

Apart from those minor problems, it’s pretty useful, and gives results, though some thought is needed to interpret those results.

Here’s an example of CDiag used to diagnose a 2 computer LAN.

IPConfig Data
First start from a pair of “ipconfig /all” output.

Windows IP Configuration
        Host Name . . . . . . . . . . . . : PChuck1
        Primary Dns Suffix  . . . . . . . : 
        Node Type . . . . . . . . . . . . : Broadcast
        IP Routing Enabled. . . . . . . . : No
        WINS Proxy Enabled. . . . . . . . : No
        DNS Suffix Search List. . . . . . : myhome.net
Ethernet adapter Local Area Connection:
        Connection-specific DNS Suffix  . : 
        Description . . . . . . . . . . . : 3Com EtherLink XL 10/100 PCI For Complete PC Management NIC (3C905C-TX)
        Physical Address. . . . . . . . . : 00-04-76-D7-E2-BA
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 192.168.1.50
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1
        DHCP Server . . . . . . . . . . . : 192.168.1.1
        DNS Servers . . . . . . . . . . . : 10.201.99.11
                                            10.201.99.33
        Lease Obtained. . . . . . . . . . : Wednesday, April 16, 2003 11:19:12
        Lease Expires . . . . . . . . . . : Wednesday, April 23, 2003 11:19:12

Windows IP Configuration
        Host Name . . . . . . . . . . . . : PChuck2
        Primary Dns Suffix  . . . . . . . : 
        Node Type . . . . . . . . . . . . : Hybrid
        IP Routing Enabled. . . . . . . . : No
        WINS Proxy Enabled. . . . . . . . : No
        DNS Suffix Search List. . . . . . : myhome.net
Ethernet adapter Local Area Connection:
        Connection-specific DNS Suffix  . : 
        Description . . . . . . . . . . . : 3Com EtherLink XL 10/100 PCI For Complete PC Management NIC (3C905C-TX)
        Physical Address. . . . . . . . . : 00-04-76-D7-A7-7E
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 192.168.1.51
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1
        DHCP Server . . . . . . . . . . . : 192.168.1.1
        DNS Servers . . . . . . . . . . . : 10.201.99.11
                                            10.201.99.33
        Lease Obtained. . . . . . . . . . : Wednesday, April 16, 2003 11:53:45
        Lease Expires . . . . . . . . . . : Wednesday, April 23, 2003 11:53:45

This identifies 2 computers, with IP addresses.

PChuck1 192.168.1.50
PChuck2 192.168.1.51

And, it identifies the default gateway.

192.168.1.1

Copy, and edit the copied raw CDiag code. In this example, you would add the above information, specifying PChuck1 and PChuck2 by name and by IP address, and specifying the default gateway by IP address.

set FullTarget1=PChuck1 192.168.1.50
set FullTarget2=PChuck2 192.168.1.51
set PingTargets=www.yahoo.com 66.94.230.32 192.168.1.1

Assembled Code
This gives the CDiag Assembled Code, which is now:

#####

@echo off
set FullTarget1=PChuck1 192.168.1.50
set FullTarget2=PChuck2 192.168.1.51
set FullTarget3=
set FullTarget4=
set FullTargets=%FullTarget1% %FullTarget2% %FullTarget3% %FullTarget4%
set FullTargets=%FullTargets% 127.0.0.1
set PingTargets=www.yahoo.com 66.94.230.32 192.168.1.1
Set Version=V1.34
@echo CDiagnosis %Version% >c:\cdiag.txt
@echo Start diagnosis for %computername% >>c:\cdiag.txt
@echo. >>c:\cdiag.txt
@echo Enumerate Shares >>c:\cdiag.txt
@echo. >>c:\cdiag.txt
net share >>c:\cdiag.txt
@echo. >>c:\cdiag.txt
@echo AdHoc Browser View >>c:\cdiag.txt
@echo. >>c:\cdiag.txt
net view >>c:\cdiag.txt
@echo. >>c:\cdiag.txt
@echo Full Targets %FullTargets% >>c:\cdiag.txt
for %%a in (%FullTargets%) do (
@echo. >>c:\cdiag.txt
@echo Target %%a >>c:\cdiag.txt
@echo. >>c:\cdiag.txt
@echo "%computername% ping %%a" >>c:\cdiag.txt
@echo. >>c:\cdiag.txt
ping %%a >>c:\cdiag.txt
@echo. >>c:\cdiag.txt
@echo "%computername% net view %%a" >>c:\cdiag.txt
@echo. >>c:\cdiag.txt
net view %%a >>c:\cdiag.txt
)
@echo. >>c:\cdiag.txt
@echo Ping Targets %PingTargets% >>c:\cdiag.txt
for %%a in (%PingTargets%) do (
@echo. >>c:\cdiag.txt
@echo Target %%a >>c:\cdiag.txt
@echo. >>c:\cdiag.txt
@echo "%computername% ping %%a" >>c:\cdiag.txt
@echo. >>c:\cdiag.txt
ping %%a >>c:\cdiag.txt
)
@echo. >>c:\cdiag.txt
@echo End diagnosis for %computername% >>c:\cdiag.txt
notepad c:\cdiag.txt
:EOF

#####

Now, I would copy and paste the above into my post, as an answer to the person who provided the “ipconfig /all” output.

If you are reading this while using CDiag in Self-Assist Mode, continue by running CDiag on each computer.

For the final step, please refer to Interpreting CDiag Output and Solving Windows Networking Problems.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: