Server Management - Remote Server Management
1752765 Members
4603 Online
108789 Solutions
New Discussion юеВ

Re: generate xml files for ilo's

 
mark q
Regular Advisor

generate xml files for ilo's

Hi,

I have a script that generates the xml files for ilo configuration, I only use parts of it but the formatting is correct and uses variables.

What I'm wondering is has anyone at hp ever thought that having a program that does this would be nice if you had to do batches of ilo's?
10 REPLIES 10
KarloChacon
Honored Contributor

Re: generate xml files for ilo's

hi

I know there is a special group that handle complex ilo scripts/interacting with perl-VBS, but normal front line does not support that just basics

regards
Didn't your momma teach you to say thanks!
KarloChacon
Honored Contributor

Re: generate xml files for ilo's

hi

I know there is a special group that handle complex ilo scripts/interacting with perl-VBS, but normal front line does not support that just basics

by the way thanks a for your script

regards
Didn't your momma teach you to say thanks!
mark q
Regular Advisor

Re: generate xml files for ilo's

I'm actually working on a way to add the computername etc to the hpsum install files which is why this all started..

if I get it going I'll post it, I'm centralizing all logging of updates and was trying to do that and I found the way to do the ilo's which was handy.

KarloChacon
Honored Contributor

Re: generate xml files for ilo's

great anything you want to share with us it is very welcome

regards
Didn't your momma teach you to say thanks!
mark q
Regular Advisor

Re: generate xml files for ilo's

I found a couple of element tags that weren't working here's the updated script

sorry about the errors
LEHayes
New Member

Re: generate xml files for ilo's

I cannot access the attached file on your message about a tool that generates the XML for HP ILO. I would be interested in this tool. Can you send it to me via email? Also could you change the extension so that it does not get filtered out?
mark q
Regular Advisor

Re: generate xml files for ilo's

how's this...

' read computername

DIM computername
DIM leftcomputername
DIM rightcomputername
DIM ilovariable
DIM finalname

'set the ilo username and password
strRILOEUser = "mmadmin"
strRILOEPW = "nt$local"

'set the settings for the network xml file
strenablenicvalue = "Yes"
strregddnsserver = "Yes"
strpinggateway = "Yes"
strdhcpdomainname = "YES"
strspeedautoselect = "Yes"
strnicspeed = "100"
strfullduplex = "Yes"
strdhcpenable = "Yes"
stripaddress = "192.168.1.1"
strsubnetmask = "255.255.255.0"
strgatewayip = "192.168.1.1"
strdomainname = "domainname.com"
strdhcpgateway = "YES"
strdhcpdnsserver = "192.168.1.1"
strdhcpwinsserver = "192.168.1.1"
strdhcpstaticroute = "192.168.1.1"
strregwinsserver = "YES"
strpridnsserver = "192.168.1.1"
strsecdnsserver = "192.168.1.1"
strterdnsserver = "192.168.1.1"
strpriwinsserver = "192.168.1.1"
strsecwinsserver = "192.168.1.1"
strstaticroute1 = "0.0.0.0"
strstaticroute2 = "0.0.0.0"
strstaticroute3 = "0.0.0.0"
strstaticroute1gateway = "0.0.0.0"
strstaticroute2gateway = "0.0.0.0"
strstaticroute3gateway = "0.0.0.0"
strenclosureipenable = "YES"
strwebagentipaddress = "192.168.1.1"

'set the variable for snmp
Set WshNetwork=WScript.CreateObject("WScript.Network")
strwebagentip = WshNetwork.ComputerName
strsnmpaddress1 = "170.6.71.231"
strsnmpaddress2 = "170.6.222.113"
strsnmpaddress3 = ""
strostraps = "Yes"
strsnmppass = "Yes"
strribtraps = "Yes"
strCIMSECURITYMASK = "3"

'set the variables for adding a user
'username to add
straddusername = "mmadmin"
'username to add's password
struserlogin ="mmadmin"
'usernames new password
strnewuserpassword ="nt$local"
stradminpriv = "Yes"
strremoteconsolepriv = "Yes"
strresetserverpriv = "Yes"
strvirtualmediapriv = "Yes"
sterconfigilopriv = "Yes"
strconfigrilopriv = "Yes"
strloginpriv = "Yes"
'the settings for this are range and subnetmask
strclientrange = "10.10.10.1 - 254.255.255.255"
strviewlogspriv = "Yes"
strclearlogspriv = "Yes"
stremsprive = "Yes"
strupdateilopriv = "Yes"
strconfgirackpriv = "Yes"
strdiagpriv = "Yes"

'set the variables for generating certificate xml file

'set the variables for directory configuration xml files
'format for this is yes or no
stdirauthenabled ="YES"
strdirlocaluseracct ="YES"
strdirserveraddress ="192.168.1.1"
strdirserverportvalue ="636"
'format for the strdirobjectdn variable is like this CN=server1_rib, OU=RIB, DC=HPRIB, DC=LABS
strdirobjectdn = "CN=server1_rib, OU=RIB, DC=HPRIB, DC=LABS"
strdirobjectpassword = "password"
'format for the strdirusercontext is like this CN=Users, DC=HPRIB, DC=LABS
strdirusercontext1 ="CN=Users, DC=HPRIB, DC=LABS"
'format for this is yes or no
strdirenablegrpacct ="YES"

'user password change variables
stdmoduserlogin = "username"
strmoduserpassword = "newpassword"

'this section of the vbs will build the name of the ilo to whatever standard you need based on the %computername% variable

'get the computername
Set WshNetwork=WScript.CreateObject("WScript.Network")
'WScript.Echo "Your Computer Name is = " & WshNetwork.ComputerName

'set the comptuername variable
COMPUTERNAME=WshNetwork.ComputerName
'WScript.Echo computername
'set the ilo name that will be inserted
ilovariable=("LO")
'WScript.Echo ilovariable

'make sure there's no spaces in the name
computername = Trim(computername)

'get the length of the computername
Count=Len(computername)
'WScript.Echo count
'WScript.Echo computername
count=count-2
'WScript.Echo count

'left trim string
leftcomputername=Left(computername,count)
'WScript.Echo leftcomputername

'trim the right string and assign it to a variable
rightcomputername = Right(COMPUTERNAME,2)
'WScript.Echo rightcomputername

finalname=leftcomputername
finalname=finalname & ilovariable
finalname=finalname & rightcomputername
'WScript.Echo "Your Ilo Name would be = " & finalname

'time to execute hp online config utility
'Executes HPONCFG.exe in order to gather iLO config

'Generate the xml file sample

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWshShell = CreateObject("Wscript.Shell")
Set XMLWrite = objFSO.CreateTextFile("Mod_Network_Settings.xml")
'generate the ilo name xml
XMLWrite.Write "" & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " -->" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.close

'generate the snmp xml configuration file
Set XMLWrite = objFSO.CreateTextFile("Mod_SNMP_IM_Settings.xml")
XMLWrite.Write "" & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.close

'generate the add_user.xml
Set XMLWrite = objFSO.CreateTextFile("add_user.xml")
XMLWrite.Write "" & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " XMLWrite.Write " USER_NAME =" & Chr(34) & straddusername & Chr(34) & "" & vbcrlf
XMLWrite.Write " USER_LOGIN =" & Chr(34) & struserlogin & Chr(34) & "" & vbcrlf
XMLWrite.Write " PASSWORD =" & Chr(34) & strnewuserpassword & Chr(34) & ">" & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " -->" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.Write "" & vbcrlf
XMLWrite.close

'xml generator for certificates import
'Set XMLWrite = objFSO.CreateTextFile("Import_Cert.xml")
'XMLWrite.Write "" & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " -----BEGIN CERTIFICATE-----" & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " -----END CERTIFICATE-------" & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.Write "" & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.close

'directory xml generator for setup of directory
'Set XMLWrite = objFSO.CreateTextFile("Mod_Directory.xml")
'XMLWrite.Write "" & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.close

'change password generator for ilo
'Set XMLWrite = objFSO.CreateTextFile("change_password.xml")
'XMLWrite.Write "" & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write " " & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.Write "
" & vbcrlf
'XMLWrite.close

'reset ilo generator this reboots the ilo
Set XMLWrite = objFSO.CreateTextFile("reset_rib.xml")
XMLWrite.Write "" & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write " " & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.Write "
" & vbcrlf
XMLWrite.close


'backup existing ilo config
Set objShell = CreateObject("Wscript.Shell")
'ObjShell.Run("%comspec% /c hponcfg /w %computername%.xml /l >%computername%iloconfig.log"), 1, True

'add the admin user
'only used on new builds
Set objShell = CreateObject("Wscript.Shell")
'ObjShell.Run("%comspec% /c hponcfg /f add_user.xml /l >add_user.log"), 1, True

'change the ilo name
Set objShell = CreateObject("Wscript.Shell")
'ObjShell.Run("%comspec% /c hponcfg /f Mod_Network_Settings.xml /l >mod_network.log"), 1, True

'write the ilo snmp settings
Set objShell = CreateObject("Wscript.Shell")
'ObjShell.Run("%comspec% /c hponcfg /f Mod_SNMP_IM_Settings.xml /l >snmp.log"), 1, True

'write the ilo certificate
Set objShell = CreateObject("Wscript.Shell")
'ObjShell.Run("%comspec% /c hponcfg /f Import_Cert.xml /l >certificate.log"), 1, True

'write the ilo directory settings
Set objShell = CreateObject("Wscript.Shell")
'ObjShell.Run("%comspec% /c hponcfg /f Mod_Directory.xml /l >directory.log"), 1, True

'write the ilo directory settings
Set objShell = CreateObject("Wscript.Shell")
'ObjShell.Run("%comspec% /c hponcfg /f change_password.xml /l >directory.log"), 1, True

'write the ilo directory settings
Set objShell = CreateObject("Wscript.Shell")
'ObjShell.Run("%comspec% /c hponcfg /f reset_rib.xml /l >directory.log"), 1, True

mark q
Regular Advisor

Re: generate xml files for ilo's

sorry this is kind of long the examples here are just test variables.
Winnetout
New Member

Re: generate xml files for ilo's

Hello Mark,

I introduce myself, my name is Cyril and I work in a company where we have ~ 800 servers.
I read that you had done a script to generate an XML file, my question is the following.
Makes you available and if so where can I find.
Thank you in advance for your help.

Good day

Cyril