2010-06-09 Ramon Novoa <rnovoa@artica.es>
* pandora_agent: Improved OS version detection. Disabled error output for plugins. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2898 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
65ad7ae396
commit
b49fc5aa9b
|
@ -1,3 +1,8 @@
|
||||||
|
2010-06-09 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* pandora_agent: Improved OS version detection. Disabled error output
|
||||||
|
for plugins.
|
||||||
|
|
||||||
2010-06-09 Ramon Novoa <rnovoa@artica.es>
|
2010-06-09 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* pandora_agent.spec: Create the man dir.
|
* pandora_agent.spec: Create the man dir.
|
||||||
|
|
|
@ -580,17 +580,26 @@ sub md5 ($) {
|
||||||
################################################################################
|
################################################################################
|
||||||
sub guess_os_version ($) {
|
sub guess_os_version ($) {
|
||||||
my $os = shift;
|
my $os = shift;
|
||||||
|
my $os_version;
|
||||||
|
|
||||||
# Linux
|
# Linux
|
||||||
return `lsb_release -sd` if ($os eq 'linux');
|
if ($os eq 'linux') {
|
||||||
|
$os_version = `lsb_release -sd 2>/dev/null`;
|
||||||
# AIX
|
# AIX
|
||||||
if ($os eq 'aix') {
|
} elsif ($os eq 'aix') {
|
||||||
return "$2.$1" if (`uname -rv` =~ /\s*(\d)\s+(\d)\s*/);
|
$os_version = "$2.$1" if (`uname -rv` =~ /\s*(\d)\s+(\d)\s*/);
|
||||||
|
# Solaris, HP-UX, BSD and others
|
||||||
|
} else {
|
||||||
|
$os_version = `uname -r`;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Solaris, HP-UX, BSD and others
|
# Something went wrong
|
||||||
return `uname -r`;
|
return '' unless defined ($os_version);
|
||||||
|
|
||||||
|
# Remove any trailing new lines
|
||||||
|
chomp ($os_version);
|
||||||
|
|
||||||
|
return $os_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -948,7 +957,7 @@ while (1) {
|
||||||
# Execute plugins
|
# Execute plugins
|
||||||
foreach my $plugin (@Plugins) {
|
foreach my $plugin (@Plugins) {
|
||||||
|
|
||||||
my $output = `$ConfDir/plugins/$plugin`;
|
my $output = `$ConfDir/plugins/$plugin 2>/dev/null`;
|
||||||
|
|
||||||
# Do not save the output if there was an error
|
# Do not save the output if there was an error
|
||||||
next unless ($? eq 0);
|
next unless ($? eq 0);
|
||||||
|
|
Loading…
Reference in New Issue