Code

new function for GOsa, trigger_action_faireboot
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Feb 2008 10:06:52 +0000 (10:06 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Feb 2008 10:06:52 +0000 (10:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9101 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/client/events/gosaTriggered.pm
gosa-si/gosa-si-client
gosa-si/modules/GosaSupportDaemon.pm
gosa-si/server/events/gosaTriggered.pm
gosa-si/tests/client.php

index e12911547b93e64f9e669bb9e571fb6ef9604427..1d70194a9d5a999c092380cd9b8e988ad860455a 100644 (file)
@@ -5,6 +5,7 @@ my @events = (
     "get_events",
     "trigger_action_localboot",
     "trigger_action_halt",
+    "trigger_action_faireboot",
     "trigger_action_reboot",
     "trigger_action_memcheck",
     "trigger_action_reinstall",
@@ -68,6 +69,13 @@ sub trigger_action_localboot {
 }
 
 
+sub trigger_action_faireboot {
+    my ($msg, $msg_hash) = @_;
+    system("/usr/sbin/faireboot");
+    return;
+}
+
+
 sub trigger_action_reboot {
     my ($msg, $msg_hash) = @_;
     print STDERR "jetzt würde ich trigger_action_reboot ausführen\n";
index f23bd11724fc97e332f832e67ceade3e76ab88b0..bde1ce2522f48dfc476788828ab0f8aa4da0b0d3 100755 (executable)
@@ -858,8 +858,6 @@ sub register_at_gosa_si_server {
 
 sub check_key_and_xml_validity {
     my ($crypted_msg, $module_key) = @_;
-#print STDERR "crypted_msg:$crypted_msg\n";
-#print STDERR "modul_key:$module_key\n";
 
     my $msg;
     my $msg_hash;
@@ -1272,7 +1270,7 @@ my $server_check = $server_check_cfg->val( "server", "ip");
 if( defined $server_check ) {
        unshift(@servers, $server_address);
        my $servers_string = join(", ", @servers);
-       daemon_log("found servers in configuration file: $servers_string", 5);
+       daemon_log("INFO: found servers in configuration file: $servers_string", 5);
 } else {
        my @tmp_servers;
        if ( !$server_domain) {
@@ -1299,11 +1297,11 @@ if( defined $server_check ) {
                } 
        }
 
-       foreach my $server (@tmp_servers) { 
-               unshift(@servers, $server); 
-       }
-       my $servers_string = join(", ", @servers);
-       daemon_log("found servers in DNS: $servers_string", 5);
+    foreach my $server (@tmp_servers) { 
+        unshift(@servers, $server); 
+    }
+    my $servers_string = join(", ", @servers);
+    daemon_log("INFO: found servers in DNS: $servers_string", 5);
 }
 
 
index 219a2fde5193f0bda81941d569453c231bd2e41e..bcf0176dae6d27c7475eabae4360c507be9b3c01 100644 (file)
@@ -25,6 +25,7 @@ use Crypt::Rijndael;
 use Digest::MD5  qw(md5 md5_hex md5_base64);
 use MIME::Base64;
 use XML::Simple;
+use utf8;
 
 my $op_hash = {
     'eq' => '=',
index d243faf6b0519d64f5475a80163807759c48f4a1..100a75f8ae0d6c1ef6a3e09c8730e73dce5102be 100644 (file)
@@ -11,6 +11,7 @@ my @events = (
     "new_key_for_client",
     "detect_hardware",
     "trigger_action_localboot",
+    "trigger_action_faireboot",
     "trigger_action_reboot",
     "trigger_action_halt",
     "trigger_action_update", 
@@ -138,6 +139,14 @@ sub set_activated_for_installation {
 }
 
 
+sub trigger_action_faireboot {
+    my ($msg, $msg_hash) = @_;
+    $msg =~ s/<header>gosa_trigger_action_faireboot<\/header>/<header>trigger_action_faireboot<\/header>/;
+    my @out_msg_l = ($msg);  
+    return @out_msg_l;
+}
+
+
 sub trigger_action_localboot {
     my ($msg, $msg_hash) = @_;
     $msg =~ s/<header>gosa_trigger_action_localboot<\/header>/<header>trigger_action_localboot<\/header>/;
index 75aeedbcece4f2dc94685362bf4616d3c420a055..debee10d9f2d6a0dcf305481fa17f8f3d5862afc 100755 (executable)
@@ -15,53 +15,66 @@ $sock->setEncryptionKey("secret-gosa-password");
 if($sock->connected()){
        /* Prepare a hunge bunch of data to be send */
 
-# add
+# jobdb add
 #$data = "<xml> <header>gosa_network_completition</header> <source>GOSA</source><target>GOSA</target><hostname>ws-muc-2</hostname></xml>";
 #$data = "<xml> <header>job_sayHello</header> <source>10.89.1.155:20083</source><mac>00:1B:77:04:8A:6C</mac> <timestamp>20130102133900</timestamp> </xml>";
 #$data = "<xml> <header>job_ping</header> <source>10.89.1.155:20083</source> <target>10.89.1.155:20081</target><mac>00:01:6c:9d:b9:fa</mac> <timestamp>20130102133900</timestamp> </xml>";
 
-# delete
+# jobdb delete
 #$data = "<xml> <header>gosa_delete_jobdb_entry</header><where><clause><phrase><id>3</id></phrase></clause></where></xml>";
 
 # smbhash
 #$data = "<xml> <header>gosa_gen_smb_hash</header> <source>GOSA</source><target>GOSA</target><password>tester</password></xml>";
 
 # Reload ldap config
-$data = "<xml> <header>gosa_trigger_reload_ldap_config</header> <source>GOSA</source><target>00:01:6c:9d:b9:fa</target></xml>";
+#$data = "<xml> <header>gosa_trigger_reload_ldap_config</header> <source>GOSA</source><target>00:01:6c:9d:b9:fa</target></xml>";
 
-# update  
+# jobdb update  
 #$data = "<xml> <header>gosa_update_status_jobdb_entry</header> <source>GOSA</source><target>GOSA</target><where><clause><phrase> <macaddress>00:01:6c:9d:b9:fa</macaddress></phrase></clause> </where> <update><timestamp>23450101000000</timestamp><result>XXXXXXXXXXXXXXx</result></update></xml>";
 #$data = "<xml> <header>gosa_update_status_jobdb_entry</header> <source>GOSA</source><target>GOSA</target><where><clause><phrase> <status>waiting</status></phrase></clause> </where> <update><status>processing</status> <result>update</result></update></xml>";
 
-# query
+# jobdb query
 #$data = "<xml><header>gosa_query_jobdb</header><where><clause><connector>and</connector><phrase><operator>gt</operator><ROWID>0</ROWID></phrase><phrase><operator>le</operator><ROWID>5</ROWID></phrase></clause></where></xml>";
 #$data= "<xml><header>gosa_query_jobdb</header><where><clause><phrase><headertag>ping</headertag></phrase></clause></where><limit><from>0</from><to>3</to></limit></xml>";
 #$data= "<xml><header>gosa_query_jobdb</header><where><clause><phrase><headertag>ping</headertag></phrase></clause></where><limit><from>0</from><to>5</to></limit><orderby>timestamp</orderby></xml>";
 #$data= "<xml><header>gosa_query_jobdb</header></xml>";
 
-# count
+# jobdb count
 #$data = "<xml> <header>gosa_count_jobdb</header></xml>";
 
-# clear
+# jobdb clear
 #$data = "<xml> <header>gosa_clear_jobdb</header> </xml>";
 
 # set gosa-si-client to 'activated'
 #$data = "<xml> <header>gosa_set_activated_for_installation</header> <target>10.89.1.31:20083</target> <source>127.0.0.1:20081</source> </xml>";
 
+
+# trigger jobs at client
 #$data = "<xml> <header>gosa_detect_hardware</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
-#$data = "<xml> <header>gosa_reboot</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
-#$data = "<xml> <header>gosa_reinstall</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
-#$data = "<xml> <header>gosa_softupdate</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
-#$data = "<xml> <header>gosa_halt</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
 #$data = "<xml> <header>gosa_new_key_for_client</header> <target>00:01:6c:9d:b9:fa</target> <source>10.89.1.31:20081</source> </xml>";
-#$data = "<xml> <header>gosa_new_key_for_client</header> <target>00:0c:29:bd:7b:e7</target> <source>10.89.1.31:20081</source> </xml>";
-#$data = "<xml> <header>gosa_new_key_for_client</header> <target>10.89.1.12:1234</target> <source>10.89.1.31:20081</source> </xml>";
-#$data = "<xml> <header>gosa_new_key_for_client</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
 #$data = "<xml> <header>gosa_trigger_action_wake</header> <target>00:01:6c:9d:b9:fa</target> <source>10.89.1.31:20081</source> </xml>";
+$data = "<xml> <header>gosa_trigger_action_faireboot</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
+#$data = "<xml> <header>job_trigger_action_reinstall</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <macaddress>00:01:6c:9d:b9:fa</macaddress> <timestamp>20130101000000</timestamp> </xml>";
+#$data = "<xml> <header>gosa_ping</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
+
+
+# to test
+#    "trigger_reload_ldap_config",
+#    "network_completition",
+#    "trigger_action_localboot",
+#    "trigger_action_faireboot",
+#    "trigger_action_reboot",
+#    "trigger_action_halt",
+#    "trigger_action_update", 
+#    "trigger_action_reinstall",
+#    "trigger_action_memcheck", 
+#    "trigger_action_sysinfo",
+#    "trigger_action_instant_update",
+#    "trigger_action_rescan",
+#    "trigger_action_wake",
+
 
 
-#$data = "<xml><header>job_trigger_action_reinstall</header><source>GOSA</source><target>00:01:6c:9d:b9:fa</target><macaddress>00:01:6c:9d:b9:fa</macaddress><timestamp>20130101000000</timestamp></xml>";
-#$data = "<xml><header>job_trigger_action_reinstall</header><source>GOSA</source><target>00:01:6c:9d:b9:fa</target><macaddress>00:01:6c:9d:b9:fa</macaddress><timestamp>98760101000000</timestamp></xml>";
 
 
     $sock->write($data);