index 8fc6318bcf69b87dfd021adf2558e858c0eed3e4..ad94ee2f0e3d45918a1dd7a4b844efde95bc0adf 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
use IO::Socket::INET;
use XML::Simple;
use Data::Dumper;
use Net::LDAP::Util;
use Socket;
use Net::hostent;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
-@ISA = ("Exporter");
+our @ISA = ("Exporter");
my $event_dir = "/usr/lib/gosa-si/server/ClientPackages";
use lib "/usr/lib/gosa-si/server/ClientPackages";
my $mesg;
my %cfg_defaults = (
-"server" => {
+"Server" => {
"ip" => [\$server_ip, "0.0.0.0"],
"mac-address" => [\$main::server_mac_address, "00:00:00:00:00"],
"port" => [\$server_port, "20081"],
### START #####################################################################
# read configfile and import variables
+#why not using the main::read_configfile !!
&local_read_configfile();
if ( defined($msg_hash->{'force-hostname'}[0]) &&
length($msg_hash->{'force-hostname'}[0]) > 0){
# $heap->{force-hostname}->{$mac_address}= $msg_hash->{'force-hostname'}[0];
- open ($TFILE, ">", "/var/tmp/$mac_address");
+ open (my $TFILE, ">", "/var/tmp/$mac_address");
print $TFILE $msg_hash->{'force-hostname'}[0];
close ($TFILE);
} else {
if($ldap_res->code) {
&main::daemon_log("$session_id ERROR: LDAP Entry for client with mac address $mac_address not found: ".$ldap_res->error, 1);
} elsif ($ldap_res->count != 1) {
- &main::daemon_log("$session_id ERROR: client with mac address $mac_address not found/unique/active - not updating ldap entry".
+ &main::daemon_log("$session_id WARNING: client with mac address $mac_address not found/unique/active - not updating ldap entry".
"\n\tbase: $ldap_base".
"\n\tscope: sub".
"\n\tattrs: ipHostNumber".
# Sanity check
if ($ldap_res->count != 1) {
- &main::daemon_log("$session_id ERROR: client with mac address $mac_address not found/unique/active - not sending syslog config".
+ &main::daemon_log("$session_id WARNING: client with mac address $mac_address not found/unique/active - not sending syslog config".
"\n\tbase: $ldap_base".
"\n\tscope: sub".
"\n\tattrs: gotoSyslogServer".
# Sanity check
if ($mesg->count != 1) {
- &main::daemon_log("$session_id ERROR: new_ldap_config: client with mac address $macaddress not found/unique/active - not sending ldap config".
+ &main::daemon_log("$session_id WARNING: new_ldap_config: client with mac address $macaddress not found/unique/active - not sending ldap config".
"\n\tbase: $ldap_base".
"\n\tscope: sub".
"\n\tattrs: dn, gotoLdapServer, FAIclass".
} else {
my $PROC_NET_ROUTE= ('/proc/net/route');
- open($FD_PROC_NET_ROUTE, "<", "$PROC_NET_ROUTE")
+ open(my $FD_PROC_NET_ROUTE, "<", "$PROC_NET_ROUTE")
or die "Could not open $PROC_NET_ROUTE";
my @ifs = <$FD_PROC_NET_ROUTE>;