index c0fe1ce90e0ac9cfdd63af30eff1f72c1d149625..5791a318eb9fd1d4392f6e43b2da8793fc700782 100644 (file)
if( inet_aton($gosa_ip) ){ $gosa_ip = inet_ntoa(inet_aton($gosa_ip)); }
$main::gosa_address = "$gosa_ip:$gosa_port";
-# create general settings for this module
-#y $gosa_cipher = &create_ciphering($gosa_passwd);
my $xml = new XML::Simple();
# import local events
my ($error, $result, $event_hash) = &import_events($event_dir);
-if ($error == 0) {
- foreach my $log_line (@$result) {
+
+foreach my $log_line (@$result) {
+ if ($log_line =~ / succeed: /) {
&main::daemon_log("0 DEBUG: GosaPackages - $log_line", 7);
- }
-} else {
- foreach my $log_line (@$result) {
+ } else {
&main::daemon_log("0 ERROR: GosaPackages - $log_line", 1);
}
}
}
}
-# moved to GosaSupportDaemon: 03-06-2008: rettenbe
-#=== FUNCTION ================================================================
-# NAME: get_interface_for_ip
-# PARAMETERS: ip address (i.e. 192.168.0.1)
-# RETURNS: array: list of interfaces if ip=0.0.0.0, matching interface if found, undef else
-# DESCRIPTION: Uses proc fs (/proc/net/dev) to get list of interfaces.
-#===============================================================================
-#sub get_interface_for_ip {
-# my $result;
-# my $ip= shift;
-# if ($ip && length($ip) > 0) {
-# my @ifs= &get_interfaces();
-# if($ip eq "0.0.0.0") {
-# $result = "all";
-# } else {
-# foreach (@ifs) {
-# my $if=$_;
-# if(get_ip($if) eq $ip) {
-# $result = $if;
-# }
-# }
-# }
-# }
-# return $result;
-#}
-
-# moved to GosaSupportDaemon: 03-06-2008: rettenbe
-#=== FUNCTION ================================================================
-# NAME: get_interfaces
-# PARAMETERS: none
-# RETURNS: (list of interfaces)
-# DESCRIPTION: Uses proc fs (/proc/net/dev) to get list of interfaces.
-#===============================================================================
-#sub get_interfaces {
-# my @result;
-# my $PROC_NET_DEV= ('/proc/net/dev');
-#
-# open(PROC_NET_DEV, "<$PROC_NET_DEV")
-# or die "Could not open $PROC_NET_DEV";
-#
-# my @ifs = <PROC_NET_DEV>;
-#
-# close(PROC_NET_DEV);
-#
-# # Eat first two line
-# shift @ifs;
-# shift @ifs;
-#
-# chomp @ifs;
-# foreach my $line(@ifs) {
-# my $if= (split /:/, $line)[0];
-# $if =~ s/^\s+//;
-# push @result, $if;
-# }
-#
-# return @result;
-#}
#=== FUNCTION ================================================================
# NAME: get_mac
return $result;
}
-# moved to GosaSupportDaemon: 03-06-2008: rettenbe
-#=== FUNCTION ================================================================
-# NAME: get_ip
-# PARAMETERS: interface name (i.e. eth0)
-# RETURNS: (ip address)
-# DESCRIPTION: Uses ioctl to get ip address directly from system.
-#===============================================================================
-#sub get_ip {
-# my $ifreq= shift;
-# my $result= "";
-# my $SIOCGIFADDR= 0x8915; # man 2 ioctl_list
-# my $proto= getprotobyname('ip');
-#
-# socket SOCKET, PF_INET, SOCK_DGRAM, $proto
-# or die "socket: $!";
-#
-# if(ioctl SOCKET, $SIOCGIFADDR, $ifreq) {
-# my ($if, $sin) = unpack 'a16 a16', $ifreq;
-# my ($port, $addr) = sockaddr_in $sin;
-# my $ip = inet_ntoa $addr;
-#
-# if ($ip && length($ip) > 0) {
-# $result = $ip;
-# }
-# }
-#
-# return $result;
-#}
-
#=== FUNCTION ================================================================
# NAME: process_incoming_msg
&main::daemon_log("$session_id ERROR: GosaPackages: no event handler or core function defined for '$header'", 1);
@out_msg_l = ();
} elsif ($out_msg_l[0] eq 'knownclienterror') {
+ &main::daemon_log("$session_id ERROR: no event handler found for '$header', check client registration events!", 1);
&main::daemon_log("$session_id ERROR: no or more than 1 hits are found at known_clients_db with sql query: '$sql_events'", 1);
- &main::daemon_log("$session_id WARNING: processing is aborted and message will not be forwarded", 3);
+ &main::daemon_log("$session_id ERROR: processing is aborted and message will not be forwarded", 1);
@out_msg_l = ();
} elsif ($out_msg_l[0] eq 'noeventerror') {
- &main::daemon_log("$session_id WARNING: client '$target' is not registered for event '$header', processing is aborted", 3);
+ &main::daemon_log("$session_id ERROR: client '$target' is not registered for event '$header', processing is aborted", 1);
@out_msg_l = ();
}
if( $error == 0 ) {
# add job to job queue
my $func_dic = {table=>$main::job_queue_tn,
- primkey=>[],
+ primkey=>['macaddress', 'headertag'],
timestamp=>$timestamp,
status=>'waiting',
result=>'none',
xmlmessage=>$msg,
macaddress=>$macaddress,
plainname=>$plain_name,
+ siserver=>"localhost",
+ modified=>"1",
};
my $res = $main::job_db->add_dbentry($func_dic);
if (not $res == 0) {
return @out_msg_l;
}
+# vim:ts=4:shiftwidth:expandtab
1;
-
-
-
-
-
-
-
-
-
-