monitoring/NOCpulsePlugins/ProbeCatalog.pm | 6 +++--- monitoring/SatConfig/general/NOCpulse-ini | 2 ++ monitoring/tsdb/LocalQueue/TSDBLocalQueue.pl | 10 +++++----- 3 files changed, 10 insertions(+), 8 deletions(-)
New commits: commit fa221cb4dbc12dcffb63755912608bc9da106fb9 Author: David Nutter david.nutter@bioss.ac.uk Date: Thu Aug 4 17:09:59 2011 +0100
Properly dereference the array references for old and new files so logfiles contain the number of files in the queue and not strings like "ARRAY(0x12323)"
diff --git a/monitoring/tsdb/LocalQueue/TSDBLocalQueue.pl b/monitoring/tsdb/LocalQueue/TSDBLocalQueue.pl index cd3be83..513716f 100755 --- a/monitoring/tsdb/LocalQueue/TSDBLocalQueue.pl +++ b/monitoring/tsdb/LocalQueue/TSDBLocalQueue.pl @@ -85,9 +85,9 @@ while (1) { }
$last_scan_time = $now; - $Log->log(1, "Rescanned directory: ", - scalar($queue_manager->current_file_keys), " current, ", - scalar($queue_manager->old_file_keys), " old\n"); + $Log->log(1, "Rescanned directory: ", + scalar(@{$queue_manager->current_file_keys}), " current, ", + scalar(@{$queue_manager->old_file_keys}), " old\n"); } otherwise { my $err = shift; $ErrorOut->print("Problem scanning directory: $err\n"); @@ -181,8 +181,8 @@ while (1) { }
# If there are no files, nod off for a while. - if (scalar($queue_manager->current_file_keys) == 0 - && scalar($queue_manager->old_file_keys) == 0) { + if (scalar(@{$queue_manager->current_file_keys}) == 0 + && scalar(@{$queue_manager->old_file_keys}) == 0) {
$Log->log(1, "No current or old files, sleep ", NO_FILES_SLEEP, "\n"); $Log->flush();
commit 5c6af5bc3fcdd52b985019f6c155db0867646988 Author: David Nutter david.nutter@bioss.ac.uk Date: Thu Aug 4 17:09:10 2011 +0100
Since autocommit is off in RHN::DB, add explicit commit to ensure our config changes are written to the database
diff --git a/monitoring/SatConfig/general/NOCpulse-ini b/monitoring/SatConfig/general/NOCpulse-ini index 3eb304d..12c8dda 100644 --- a/monitoring/SatConfig/general/NOCpulse-ini +++ b/monitoring/SatConfig/general/NOCpulse-ini @@ -103,6 +103,7 @@ if ($set_macro) { my $sth = $ini->dbh->prepare($sql); $sth->execute($new_value, $set_macro); print $sth->rows, " record updated.\n"; + $ini->dbh->commit(); $save = 1; } elsif ($set_param) { if (!@groups or scalar(@groups) != 1) { @@ -118,6 +119,7 @@ if ($set_macro) { my $sth = $ini->dbh->prepare($sql); $sth->execute($new_value, $groups[0], $set_param); print $sth->rows, " record updated.\n"; + $ini->dbh->commit(); $save = 1; }
commit 8e9294be7e895bc7dc7f7c2de29469092059f026 Author: David Nutter davidn@elrond.bioss.sari.ac.uk Date: Thu Aug 4 17:06:41 2011 +0100
Add additional member name mappings in ProbeRecord to ensure that the probe will run when rhn-runprobe is called.
Changed ProbeCatalog to use correct hash key names when listing probes
diff --git a/monitoring/NOCpulsePlugins/ProbeCatalog.pm b/monitoring/NOCpulsePlugins/ProbeCatalog.pm index 8b0c422..9dd00c6 100644 --- a/monitoring/NOCpulsePlugins/ProbeCatalog.pm +++ b/monitoring/NOCpulsePlugins/ProbeCatalog.pm @@ -35,10 +35,10 @@ sub describe { my $result; if ($probe_id) { $result = $probeHashRef->{RECID}.' '.$probeHashRef->{PROBE_TYPE};; - if ($probeHashRef->{hostName}) { - $result .= ' on '.$probeHashRef->{hostName}.' ('.$probeHashRef->{hostAddress}.')'; + if ($probeHashRef->{HOSTNAME}) { + $result .= ' on '.$probeHashRef->{HOSTNAME}.' ('.$probeHashRef->{HOSTADDRESS}.')'; } else { - $result .= ' on '.$probeHashRef->{hostAddress}; + $result .= ' on '.$probeHashRef->{HOSTADDRESS}; } $result .= ': '.$probeHashRef->{DESCRIPTION};
spacewalk-commits@lists.fedorahosted.org