Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to obtain system information to be used for support purpose?

Status
Not open for further replies.

pcwc66

IS-IT--Management
Dec 14, 2001
163
US
Hi,

For support purpose, it is necessary to know what OS and other system information such as platform, dlls version the application is running on. I know such information can be retrieved using some foxpro functions, API, and windows scripts. However, I only know how to obtain the information for the workstation but not if the application is located at a file server. For example, if I have a program with the following lines:

?OS()
?VERSION()
and run it in the local machine. I will get the OS and Foxpro version information of the local machine. However, if the program is located in a file server and I run the program from my local machine, I will still get the OS and Foxpro version information of the local machine instead of the file server. I will like to know how to get the OS and other system information of the file server in such scenario since some problems may be due to the environment of the file server instead of the local machine. Another scenario can be that running an application in my local machine and use ODBC to connect to a sql server on another machine. In this case, both machine's environment will have effect on the application. I hope this is clear enough.

Thank you for any help.
 
What sort of information are you looking for on a file server that could be relevant to your app?
In my humble opinion, it shouldn't matter what the environment is on the file server. The file server is just that - a file server. It is supposed to basically be a repository for shared information. All you should really care about is where the shared files are located, drive mappings, etc. Chances are, even if you (you being your app) knew what the environment was, you couldn't do anything about it if it needed changing, because you wouldn't have sufficient rights.
As for an ODBC (or other) connection to SQL Sever or whatever data source, that would have to be configured on the local PC by an admin, or the admin would have to provide the info to you so you could access it anyway. And from there, given you had access rights you could glean the information from the local PC anyway. It should be up to the admin to have SQL Server installed and configured properly to enable other processes to access it.

Maybe I'm just not seeing things the way you are (it is still early here on Pacific time) but I'm open to clarification.



-Dave S.-
[cheers]
Even more Fox stuff at:
 
Hi Dave,

Thank you for your input. One main point I want to clarify is that my intention is not to change anything programmatically but only to retreive information which will make supporting an applicaton more efficient. I believe you have seen some companies will require their users to fill out a support form which will ask information such as OS, platform, and so on. Basically, I want to automate this so users don't need to search for such information. Ideally, this should be handled by IT staffs but not all companies will have IT staffs. Also, different applications may rely on different system files such as dlls, ocx, and so on. I believe most IT staffs will not have detail knowledge of all the applications used in their companies. I hope you understand my purpose now.

Regarding to File Server, I believe you're right that I probably won't need the information. However, I kind of remember that sometimes the setting of the File Server can have impact of the application. If I remember correctly, a Novell File Server has setting to # of file locks or something similar. In such case, it will be nice to know that the file server is a novell server. It will be even nicer to know the settings.

Regarding to the server which contains the SQL Server, it is important to know information such as SQL SERVER version and OS. I believe most of the information can be retreived using SQL Server functions. As of now, I cannot think of something which is relevant for supporting purpose and cannot be retreived using SQL Server fucntions.

For example, SQL Server has the utility sqldiag.exe. The following is quoted directly from SQL Server Books Online:

sqldiag is intended to expedite and simplify information gathering by Microsoft Product Support Services.

I don't think I will retreive as much information as sqldiag.exe but some of it and information which is only related to a specific application but my intention is same as sqldiag.exe.

I hope this is very clear so you and others can provide me any helpful information and suggestions.


BTW, your site seems to be very helpful. I probably will check it out more when I have more time.


Thank you for your help.










 
Thanks for checking out my site. There are a couple good things on there. [smile]

I haven't tried gathering any information from a server, other than the basic stuff an API or script would give out.
This may help though, and save you a lot of programming. Below is a link to a web site where I obtained some awesome software. In fact, I built an inventory system for our company around it. What it does is gathers up all sorts of information on your computer, as well as everything that's connected to it.
From there, you can create reports, output the listing to a file, even statistics for any or all computers you choose to query.
It can be run as a server, so it can be accessed remotely, or a customer could run it manually and send you a report.
Anyway, check it out. It is quite excellent.



-Dave S.-
[cheers]
Even more Fox stuff at:
 
Hi Dave,

I already have aida32 in my machine. Unfortunately, I cannot use it. I need to implement the coding into an existing application using VFP 8.


Thank you for your help.
 
You might be able to adapt code for the WSHController. (e.g. CreateObject("WSHController")).

It is defined as allowing you to "remotely administer computer systems on a computer network. It represents an instance of a WSH script, i.e., a script file with one of the following extensions: .wsh, .wsf, .js, .vbs, .jse, .vbe, and so on"

I tried tweaking the provided VB example, but I'm running into 'issues'.

[VBScript]
Dim Controller, RemoteScript
Set Controller = WScript.CreateObject("WSHController")
Set RemoteScript = Controller.CreateScript("test.js", "remoteserver")
RemoteScript.Execute

Do While RemoteScript.Status <> 2
WScript.Sleep 100
Loop

Brian
 
Hi Brian,

Thank you for the info. This new object in WSH 5.6 may suit the purpose however I wonder whether there is any similar object that will prevent execution of any scripts which will be overwritten anything in the remote machine. For my purpose, I just need something that can retrieve information.

I assume your problem is not related to the need to enable this object in the registry.
 
Another possibility would be to remotely schedule a script to run using AT scheduler via the RUN command:

Get Server Time Using

NET TIME \\<Remote Machine>

Run the AT command to schedule the desired program (e.g. '.fxp') to run on the remote system.

AT \\<Remote Machine> <Time> <Command>

Have the .fxp write a text file with system info for you to get.
 
pcwc66,

Is this the type of thing you are looking for?


...you'd have to tweak the example for NT 4.0 and above OS but a simple check of the client OS could be done and then run the appropriate code.

Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
&quot;Whom computers would destroy, they must first drive mad.&quot; - Anon​
[/sup]
 
Hi Slighthaze,

I tried to change the Win98 example to Win 2000 but I'm getting the wrong result.

I changed the declaration to:

PROCEDURE decl
DECLARE INTEGER NetServerGetInfo IN Netapi32;
STRING pszServer, INTEGER sLevel,;
STRING @pbBuffer

and modified few lines:

lnBufsize = 50 && large enough to fit
lcBuffer = space(50)

lnResult = NetServerGetInfo (lcServerName, 100, @lcBuffer)
? &quot;Server name:&quot;, buf2dword(SUBSTR(lcBuffer, 1,4))

will return 1499136 (this number will vary if I run it again).

I'm not sure how to count the buffer size and how to convert the content of lcBuffer to meaningful information.


Thank you for any help.



 
pcwc66,

Sorry it has taken me awhile to get back to this thread. I have been very busy lately, but will try to get back to this soon and offer the appropriate code changes to the example, if you haven't gotten it yourself by then.

Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
&quot;Whom computers would destroy, they must first drive mad.&quot; - Anon​
[/sup]
 
Hi Slighthaze,

I haven't gotten it yet. I'm also very busy in attending Microsoft training.

Thank you for your help.
 
Hi Slighthaze,

I'm back from the Microsoft Training. I wonder whether you have a chance to change the example's coding. Actually, I'm very interested in learning how to make the changes.
Do you know of any articles which will help me on this?


Thank you for your help.
 
Check this update showing how to call NetServerGetInfo under Win2000/XP:

In the example convert cBuffer into cursor like the following:
Code:
CREATE CURSOR csResult (ch C(1), asc I)
FOR ii=1 TO Len(cBuffer)
   ch = SUBSTR(cBuffer, ii,1)
   INSERT INTO csResult VALUES (m.ch, asc(m.ch))
ENDFOR

It might give you some better understanding of the structure.
 
Hi tek2tips,

Thank you for the information. This update must be very new. Now, I just need to spend time to understand the example.

 
Actually I put this update two days ago after reading this thread. Anything I can do :)
 
I'm trying the NetServerGetInfo under Windows 98 SE. At first, I assign .NULL. to lcServerName. I guess this means local machine. I get the error code 2114. By searching this code in the internet, I find this code stands for &quot;The Server service is not started.&quot; I guess this is because NetServerGetInfo will not work for Windows 98 SE since it is not a server. So, I changed the lcServerName to a Windows 2000 server name in the network. Then I get the error code 124 which is &quot;The system call level is not correct.&quot;

I have also tried the NetServerGetInfo under Windows 2000 Server. I get the following result:

Platform ID: 500
Major Version: 5
Minor Version: 0
Software Type: 167943
Server Name: WIN2K

I believe Platform ID 500 means NT, Major Version 5 plus Minor Version 0 means Windows 2000. I cannot figure out the Software Type value 167943.

Thank you for any help.



However, I cannot figure out the returned Software Type value 167943.
 
pcwc66,

Most of constant value in C using Hex. It is much easier to see if you transform it into hex

167943 = 0x29007

Code:
Server type constant:
SV_TYPE_WORKSTATION     = 0x00001
SV_TYPE_SERVER          = 0x00002
SV_TYPE_SQLSERVER       = 0x00004
SV_TYPE_NT              = 0x01000
SV_TYPE_SERVER_NT       = 0x08000
SV_TYPE_BACKUP_BROWSER  = 0x20000
                       -----------
                        = 0x29007

Hope it helps

-- AirCon --
 
Hi AirCon,

I know about converting that number into hex but I don't know that I can add up the hex. Since the value 167943 (0x29007) = the sum of Server type constant, does it mean that the computer is running all those software.

Thank you for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top