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:
parent
461824ef86
commit
9b18e175ef
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue