Scripting with Visual Basic. Fujitsu iRMC S4
Publicité
Publicité
iRMC system report
– HTTPS Access with a LDAP user account:
Please note that, for LDAP users, you have to specify basic authentication since the authentication parameters need to be passed to the LDAP server for verification: curl --basic -k -u LDAPuser:LDAPpassword https://192.168.1.100/report.xml
12.3.1.2 Scripting with Visual Basic
Scripting is also possible with Visual Basic. The following VB script retrieves the report.xml from the iRMC and saves it into a local file, also named report.xml:
IP_ADRESSE = "192.168.1.100"
USER_NAME = "admin"
PASSWORD = "admin"
FILE_NAME = ".\\report.xml"
ADDONS = "/report.xml"
' --------------------------------------------------------------
----------------------------------
On Error Resume Next
Function SaveBinaryData(FileName, ByteArray)
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
Dim BinaryStream
Set BinaryStream = CreateObject("ADODB.Stream")
BinaryStream.Type = adTypeBinary
BinaryStream.Open
BinaryStream.Write ByteArray
BinaryStream.SaveToFile FileName, adSaveCreateOverWrite
WScript.Echo "Antwort:" & BinaryStream.Read
End Function
Set xmlHttp = CreateObject("Msxml2.XMLHTTP")
xmlHttp.Open "GET", "http://" & IP_ADRESSE & ADDONS, False,
USER_NAME, PASSWORD
xmlHttp.Send
If InStr(xmlHttp.GetResponseHeader("Content-Type"), "xml") > 0
Then
SaveBinaryData FILE_NAME,xmlHttp.ResponseBody
Else
Wscript.Echo ADDONS &" not found on " &IP_ADRESSE
End If
468
iRMC
Télécharger
Publicité