]> git.zerfleddert.de Git - rsbs2/commitdiff
add function to enable syslog debug messages from the RSB
authorMichael Gernoth <michael@gernoth.net>
Sat, 31 Jan 2009 22:23:42 +0000 (23:23 +0100)
committerMichael Gernoth <michael@gernoth.net>
Sat, 31 Jan 2009 22:23:42 +0000 (23:23 +0100)
rsbs2

diff --git a/rsbs2 b/rsbs2
index 2ad767e6768984f5441007698cfa9d7681012530..28aa093abc2d16bb90884eb8f8ac71a376fa6c78 100755 (executable)
--- a/rsbs2
+++ b/rsbs2
@@ -235,6 +235,27 @@ sub show_all_vars {
        }
 }
 
        }
 }
 
+sub syslog_debug {
+       my $destination_ip = shift;
+       my $bcast = shift;
+
+       $reqstr='<?xml version="1.0"?><?RMCXML version="1.0"?><RMCSEQ><REQ CMD="dbgmsglancfg"><IP>'.${destination_ip}.'</IP><BCAST>'.${bcast}.'</BCAST><STORE>FALSE</STORE></REQ></RMCSEQ>';
+       $res = _req($reqstr);
+       if ($res->{RESP}->{RC} ne '0x0') {
+               print "FAILED:".$res->{RESP}->{RC}."\n";
+               return;
+       }
+
+       $reqstr='<?XML version="1.0"?><?RMCXML version="1.0"?><RMCSEQ><REQ CMD="dbgmsgcfg"><ON>TRUE</ON><CHANNELMASK>0x0</CHANNELMASK><MMASK>0x0</MMASK><STORE>FALSE</STORE></REQ></RMCSEQ>';
+       $res = _req($reqstr);
+       if ($res->{RESP}->{RC} ne '0x0') {
+               print "FAILED:".$res->{RESP}->{RC}."\n";
+               return;
+       }
+
+       print "Debug messages will be sent to ${destination_ip} (broadcast: ${bcast})\n";
+}
+
 #Login...
 my $response = $ua->get("http://${host}/cgi/challenge");
 die $response->status_line if (!($response->is_success));
 #Login...
 my $response = $ua->get("http://${host}/cgi/challenge");
 die $response->status_line if (!($response->is_success));
@@ -280,12 +301,13 @@ printf("byte 22: 0x%x\n", ord($board[22]));
 #showprop("SERVER_POWER_ON_PULSE_MS");
 #showprop("SERVER_POWER_OFF_MODE");
 #showprop("SERVER_POWER_OFF_PULSE_MS");
 #showprop("SERVER_POWER_ON_PULSE_MS");
 #showprop("SERVER_POWER_OFF_MODE");
 #showprop("SERVER_POWER_OFF_PULSE_MS");
-#showprop("FP_COMREDIRECT");
 
 board_properties();
 
 #show_all_vars();
 
 
 board_properties();
 
 #show_all_vars();
 
+syslog_debug("255.255.255.255", "TRUE");
+
 #server_power_on modes: (com/agilent/rmc/mgui/panels/PowerMgmtConf.class)
 #0: l_pmconf_option_disabled
 #1: l_pmconf_option_atx
 #server_power_on modes: (com/agilent/rmc/mgui/panels/PowerMgmtConf.class)
 #0: l_pmconf_option_disabled
 #1: l_pmconf_option_atx
@@ -302,15 +324,15 @@ setprop("FP_REMOTE_POWER", "TRUE");
 setprop("SERVER_POWER_ON_MODE", sprintf("0x%x", $pmode));
 setprop("SERVER_POWER_OFF_MODE", sprintf("0x%x", $pmode));
 #Hack: Abuse powercycloe for powerup and down...
 setprop("SERVER_POWER_ON_MODE", sprintf("0x%x", $pmode));
 setprop("SERVER_POWER_OFF_MODE", sprintf("0x%x", $pmode));
 #Hack: Abuse powercycloe for powerup and down...
-setprop("SERVER_POWER_ON_PULSE_MS", "0x0");
+#setprop("SERVER_POWER_ON_PULSE_MS", "0x0");
 
 #$reqstr='<?xml version="1.0"?><?RMCXML version="1.0"?><RMCSEQ><REQ CMD="boardpropset"><BPROP NAME="BOARD_DESCRIPTION"><VAL>'.$boarddesc_new.'</VAL></BPROP></REQ></RMCSEQ>';
 #print $reqstr."\n";
 #print Dumper(_req($reqstr));
 
 serveraction("hardreset");
 
 #$reqstr='<?xml version="1.0"?><?RMCXML version="1.0"?><RMCSEQ><REQ CMD="boardpropset"><BPROP NAME="BOARD_DESCRIPTION"><VAL>'.$boarddesc_new.'</VAL></BPROP></REQ></RMCSEQ>';
 #print $reqstr."\n";
 #print Dumper(_req($reqstr));
 
 serveraction("hardreset");
-#serveraction("powerup");
-#serveraction("powerdown");
+serveraction("powerup");
+serveraction("powerdown");
 serveraction("powercycle");
 
 logout();
 serveraction("powercycle");
 
 logout();
Impressum, Datenschutz