HP iLO information

(imported topic written by SystemAdmin)

Hi,

I am trying to write a BigFix fixlet to check for the existance of a file, if it exists, create a copy of it, delete the file and then execute a command to write the HP iLO information out to that file, this is the actionscript I have written but for some reason it doesn’t work:

if (exists file “c:\ilo_config.old.xml”) then (delete “c:\ilo_config.old.xml”)

if (exists file “c:\ilo_config.xml”) then (move “c:\ilo_config.xml” “c:\ilo_config.old.xml”)

dos C:\hp\hpsmh\data\cgi-bin\vcagent\Discovery\HPONCFG.exe /w c:\ilo_config.xml

dos “C:\Program Files\HP\hponcfg\hponcfg.exe” /w c:\ilo_config.xml

Can anyone help me on this?

Thanks

Anthony

(imported comment written by MattBoyd)

When you use relevance expressions in actions, you need to surround them with curly braces instead of parentheses:

if {exists file “c:\ilo_config.old.xml”}

delete “c:\ilo_config.old.xml”}

endif

if {exists file “c:\ilo_config.xml”}

move “c:\ilo_config.xml” “c:\ilo_config.old.xml”

endif

dos C:\hp\hpsmh\data\cgi-bin\vcagent\Discovery\HPONCFG.exe /w c:\ilo_config.xml

dos “C:\Program Files\HP\hponcfg\hponcfg.exe” /w c:\ilo_config.xml

(imported comment written by SystemAdmin)

Thanks boyd, that works brilliantly but now I can’t seem to get the information out of the file! I would like to get the IP address from the output file listed below but the file MAY have two different formats (see both below). Any suggestions as to how I could acheive this? I used the following working property relevance for the second file, but try as I have, I cannot get this to work with the first file and I certainly can’t combine them!

node values of attributes of selects “/RIBCL/LOGIN/RIB_INFO/MOD_NETWORK_SETTINGS/IP_ADDRESS” of xml document of file “C:\ilo_config.xml”

OUTPUT1:

<MOD_DIR_CONFIG>

<DIR_AUTHENTICATION_ENABLED VALUE = “N”/>

<DIR_LOCAL_USER_ACCT VALUE = “Y”/>

<DIR_SERVER_ADDRESS VALUE = “”/>

<DIR_SERVER_PORT VALUE = “x”/>

<DIR_OBJECT_DN VALUE = “”/>

<DIR_OBJECT_PASSWORD VALUE = “”/>

<DIR_USER_CONTEXT_1 VALUE = “”/>

<DIR_USER_CONTEXT_2 VALUE = “”/>

<DIR_USER_CONTEXT_3 VALUE = “”/>

</MOD_DIR_CONFIG>

<MOD_NETWORK_SETTINGS>

<SPEED_AUTOSELECT VALUE = “N”/>

<NIC_SPEED VALUE = “100”/>

<FULL_DUPLEX VALUE = “Y”/>

<IP_ADDRESS VALUE = “I.I.I.I”/>

<SUBNET_MASK VALUE = “x.x.x.x”/>

<GATEWAY_IP_ADDRESS VALUE = “x.x.x.x”/>

<DNS_NAME VALUE = “SERVERNAME-ILO”/>

<PRIM_DNS_SERVER value = “x.x.x.x”/>

<DHCP_ENABLE VALUE = “N”/>

<DOMAIN_NAME VALUE = “”/>

<DHCP_GATEWAY VALUE = “Y”/>

<DHCP_DNS_SERVER VALUE = “Y”/>

<DHCP_STATIC_ROUTE VALUE = “Y”/>

<DHCP_WINS_SERVER VALUE = “Y”/>

<REG_WINS_SERVER VALUE = “Y”/>

<PRIM_WINS_SERVER value = “x.x.x.x”/>

<STATIC_ROUTE_1 DEST = “0.0.0.0” GATEWAY = “0.0.0.0”/>

<STATIC_ROUTE_2 DEST = “0.0.0.0” GATEWAY = “0.0.0.0”/>

<STATIC_ROUTE_3 DEST = “0.0.0.0” GATEWAY = “0.0.0.0”/>

</MOD_NETWORK_SETTINGS>

<ADD_USER

USER_NAME = “USERNAME”

USER_LOGIN = “USERNAME”

PASSWORD = “”>

</ADD_USER>

<RESET_RIB VALUE = “Y”/>

OUTPUT2:

<DIR_INFO MODE=“write”>

<MOD_DIR_CONFIG>

<DIR_AUTHENTICATION_ENABLED VALUE = “N”/>

<DIR_LOCAL_USER_ACCT VALUE = “Y”/>

<DIR_SERVER_ADDRESS VALUE = “”/>

<DIR_SERVER_PORT VALUE = “X”/>

<DIR_OBJECT_DN VALUE = “”/>

<DIR_OBJECT_PASSWORD VALUE = “”/>

<DIR_USER_CONTEXT_1 VALUE = “”/>

<DIR_USER_CONTEXT_2 VALUE = “”/>

<DIR_USER_CONTEXT_3 VALUE = “”/>

</MOD_DIR_CONFIG>

</DIR_INFO>

<RIB_INFO MODE=“write”>

<MOD_NETWORK_SETTINGS>

<SPEED_AUTOSELECT VALUE = “N”/>

<NIC_SPEED VALUE = “100”/>

<FULL_DUPLEX VALUE = “Y”/>

<DHCP_ENABLE VALUE = “N”/>

<DHCP_GATEWAY VALUE = “Y”/>

<DHCP_DNS_SERVER VALUE = “Y”/>

<DHCP_STATIC_ROUTE VALUE = “Y”/>

<DHCP_WINS_SERVER VALUE = “Y”/>

<REG_WINS_SERVER VALUE = “Y”/>

<IP_ADDRESS VALUE = “I.I.I.I”/>

<SUBNET_MASK VALUE = “x.x.x.x”/>

<GATEWAY_IP_ADDRESS VALUE = “x.x.x.x”/>

<DNS_NAME VALUE = “SERVERNAME-ilo”/>

<DOMAIN_NAME VALUE = “DOMAINNAME”/>

<PRIM_DNS_SERVER value = “x.x.x.x”/>

<SEC_DNS_SERVER value = “x.x.x.x”/>

<TER_DNS_SERVER value = “0.0.0.0”/>

<PRIM_WINS_SERVER value = “x.x.x.x”/>

<SEC_WINS_SERVER value = “x.x.x.x”/>

<STATIC_ROUTE_1 DEST = “0.0.0.0” GATEWAY = “0.0.0.0”/>

<STATIC_ROUTE_2 DEST = “0.0.0.0” GATEWAY = “0.0.0.0”/>

<STATIC_ROUTE_3 DEST = “0.0.0.0” GATEWAY = “0.0.0.0”/>

</MOD_NETWORK_SETTINGS>

</RIB_INFO>

<USER_INFO MODE=“write”>

</USER_INFO>

(imported comment written by SystemAdmin)

I suppose you could do the xml node process, but this relevance seems to work for both file formats:

preceding text of first “%22” of following text of first “= %22” of lines whose(it contains “<IP_ADDRESS VALUE”) of file “c:\ilo_config.xml”

For the other, you could use the version info to help decide which node path to use to filter the data and combine two separate relevances to pull the data. But unless you are going to try to do something a bit more complicated, I don’t see the problem with just using the string match/parse relevance above.

-Jim

(imported comment written by NoahSalzman)

Other “RIBCL” threads:

http://forum.bigfix.com/viewtopic.php?id=6122

http://forum.bigfix.com/viewtopic.php?id=5939

http://forum.bigfix.com/viewtopic.php?id=5846

(imported comment written by SystemAdmin)

Thanks Jim, that worked perfectly!

Noah, thanks for the info.