Hello,

If the clients and servers are both Windows systems, then you might want
to try the following script. You need administrator rights for it on the
network and the server must be running as it tries to retrieve a running
process from the server. I am not sure if there is another way and it
only works on Windows. But if there is another way, then I would like to
know that too!

'<--Begin Code-->
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = FSO.CreateTextFile("MySQL.csv", True)
For i = 100 To 105
                strIP = "192.168.128." & CStr(i)
                Set PingResults =
GetObject("winmgmts:{impersonationLevel=impersonate}//./root/cimv2") _
                .ExecQuery("SELECT * FROM Win32_PingStatus WHERE Address
= '" + strIP + "'")
                For Each PingResult In PingResults
                        If PingResult.StatusCode = 0 Then
                                If LCase(strIP) =
PingResult.ProtocolAddress Then TestComputer(strIP)
                        End If
                Next
Next
Set objTextFile = Nothing
Set FSO = Nothing

Sub TestComputer(strComputer)
        Set MySQLProc = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2").ExecQuery("Select * from Win32_Process",,48)
        For Each ProcItem in MySQLProc
                sProc = ProcItem.Caption
                iProc = InStr(1, sProc, "mysqld", vbtextcompare)
                arOS = Split(ProcItem.OSName, "|")
                If iProc > 0  Then 
                        objTextFile.WriteLine strIP & ";" & sProc & ";"
& arOS(0) & ";" & ProcItem.WindowsVersion
                End If
        Next
End Sub 
'<--End Code-->

HTH,
Arjan.


-----Original Message-----
From: suomi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 09, 2005 09:07 AM
To: mysql@lists.mysql.com
Subject: how to find out the name of the server

Hi every

probably silliest question ever posted:

we are running mysql on serveral hosts and sometime it is important to
know, which host is the mysql server you are connected to.

this is not a session nor a global variable, there is no show
statement...

what is it else? how to ask a mysql client the name of the server you
are connected to?

suomi

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



-- 
The information contained in this communication and any attachments is 
confidential and may be privileged, and is for the sole use of the intended 
recipient(s). Any unauthorized review, use, disclosure or distribution is 
prohibited. If you are not the intended recipient, please notify the sender 
immediately by replying to this message and destroy all copies of this message 
and any attachments. ASML is neither liable for the proper and complete 
transmission of the information contained in this communication, nor for any 
delay in its receipt.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to