2012-04-26 Dario Rodriguez <dario.rodriguez@artica.es>

* unix/plugins/inventory: Fixed inventory plugin



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6189 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
darode 2012-04-26 12:02:47 +00:00
parent 461824ef86
commit 9b18e175ef
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2012-04-26 Dario Rodriguez <dario.rodriguez@artica.es>
* unix/plugins/inventory: Fixed inventory plugin
2012-04-25 Sergio Martin <sergio.martin@artica.es>
* unix/plugins/inventory: Fixed method of obtain

View File

@ -91,18 +91,19 @@ sub get_servicies_init_machine($$) {
my $script = "";
if (-e "/etc/rc" . $runlevel .".d/") {
$script = "ls /etc/rc" . $runlevel .".d/ -l | grep \"^l.*\" | grep \" S.* \" | cut -d' ' -f11";
$script = "ls /etc/rc" . $runlevel .".d/ -l | grep \"^l.*\" | awk \"{print \\\$NF}\" | sed -e \"s/\\.\\.\\///g\" | sed -e \"s/.*init\\.d\\///g\"";
}
else {
$script = "ls /etc/rc.d/rc" . $runlevel .".d/ -l | grep \"^l.*\" | grep \" S.* \" | cut -d' ' -f11";
$script = "ls /etc/rc.d/rc" . $runlevel .".d/ -l | grep \"^l.*\" | grep \" S.* \" | awk \"{print \\\$NF}\" | sed -e \"s/\\.\\.\\///g\" | sed -e \"s/.*init\\.d\\///g\"";
}
my @services = `$script`;
foreach my $row (@services) {
next unless ($row =~ /^\S+\/(\S+)$/);
my %module;
$module{'service'} = $1;
$row =~ s/\n//;
$module{'service'} = $row;
$module{'_keys'} = ['service'];
push (@{$modules->{$name}}, \%module);
}