Hello,
i tried to define the "missing subroutine" inside the Update.pm file:
sub set_saas{
my $dbh = $Apache::Ocsinventory::CURRENT_CONTEXT{'DBI_HANDLE'};
my @saas_exp = get_saas();
my $saas_en = 0;
my $sql;
$sql = $dbh->prepare("SELECT ivalue FROM config WHERE config.name='INVENTORY_SAAS_ENABLED'");
$sql->execute;
while (my $row = $sql->fetchrow_hashref()){
$saas_en = $row->{ivalue};
}
if ($saas_en == 1) {
foreach my $saas (@{$Apache::Ocsinventory::CURRENT_CONTEXT{'XML_ENTRY'}->{CONTENT}->{SAAS}}){
my $entry = $saas->{ENTRY};
foreach my $exp (@saas_exp) {
my $dnsExp = $exp->{DNS_EXP};
$dnsExp =~ s/\?/\./g;
$dnsExp =~ s/\*/\.\*/g;
if ($entry =~ /$dnsExp/ || $dnsExp =~ /$entry/ ) {
$dbh->do("INSERT INTO saas (SAAS_EXP_ID, HARDWARE_ID, ENTRY, DATA, TTL) VALUES (?,?,?,?,?)", {}, $exp->{ID}, $Apache::Ocsinventory::CURRENT_CONTEXT{'DATABASE_ID'}, $entry, $saas->{DATA}, $saas->{TTL});
}
}
}
}
return 1;
}
-------
Thats out of the saas.pm file from github contributions. Since i'm not a perl expert it was only a try - and seems not to work.
Apache Error Log is empty on that topic, the access_log shows a post command for the entry when testing with one host manually. OCS NG Gui shows no hosts at all.
Any ideas?
Regards, Stefan
Update:
I removed the 2.5 server installation completely and dropped the database. Then reinstalled the RPMs for RHEL7 and the OCS Server 2.4. Then its working. Afterwards i updated the OCS NG Server to V2.5. Now the connections working and the logs are clean. Cant say what was wrong.