Subject: | Patch to get SERVER_NAME |
Hi,
I just needed to get the iLo-Value SERVER_NAME and hacked Net::ILO a bit.
Distribution Version: Net::ILO 0.54
Perl: 5.10.1
OS: Ubuntu Lucid 64-bit
Here what I did:
[markus@krusty 55] ilo-tools > svn diff Net-ILO/lib/Net/ILO.pm
Index: Net-ILO/lib/Net/ILO.pm
===================================================================
--- Net-ILO/lib/Net/ILO.pm (Revision 1931)
+++ Net-ILO/lib/Net/ILO.pm (Arbeitskopie)
@@ -825,7 +825,22 @@
}
+sub server_name {
+ my $self = shift;
+ my $ilo_command = $self->_generate_cmd('get_server_name');
+ my $response = $self->_send($ilo_command) or return;
+ my $xml = $self->_serialize($response) or return;
+
+ if ( my $errmsg = _check_errors($xml) ) {
+ $self->error($errmsg);
+ return;
+ }
+
+ my $server_name = $xml->{SERVER_NAME}->{VALUE};
+ return lc($server_name);
+}
+
sub session_timeout {
my $self = shift;
@@ -1136,6 +1151,10 @@
<GET_NETWORK_SETTINGS/>
</RIB_INFO> ),
+ 'get_server_name' => qq( <SERVER_INFO MODE="READ" >
+ <GET_SERVER_NAME />
+ </SERVER_INFO> ),
+
'power_consumption' => qq( <SERVER_INFO MODE="read">
<GET_POWER_READINGS/>
</SERVER_INFO> ),
You can use it like this:
my $name = $ilo->server_name or die $ilo->error;
If you need anything else, please let me know.
Regards, Markus