Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated systemctl to have sudo in front to match #238

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


"""
Systemd perf output('systemctl list-units --all --type=service --plain --full --no-page --no-legend')
Systemd perf output('sudo systemctl list-units --all --type=service --plain --full --no-page --no-legend')

...
accounts-daemon.service loaded active running Accounts Service
Expand All @@ -27,10 +27,10 @@
...


Systemd model output('for i in $(systemctl list-units -t service --all
Systemd model output('for i in $(sudo systemctl list-units -t service --all
--no-page --no-legend | sed /not-found/d | cut -d" " -f1) ;
do echo "__SPLIT__" ;
systemctl show -p Names,Type,Description,LoadState,
sudo systemctl show -p Names,Type,Description,LoadState,
ActiveState,UnitFileState,MainPID,ConditionResult $i ; done'):
...
Type=oneshot
Expand Down Expand Up @@ -326,11 +326,11 @@ def validate_modeling_regex(device, log):
if command -v systemctl >/dev/null 2>&1
then
echo SYSTEMD
for i in $(systemctl list-units --all --type=service --plain --full --no-page --no-legend | sed /not-found/d | cut -d" " -f1)
for i in $(sudo systemctl list-units --all --type=service --plain --full --no-page --no-legend | sed /not-found/d | cut -d" " -f1)
do
echo __SPLIT__
echo Title=$i
systemctl show -p Type,Description,ActiveState,UnitFileState,ConditionResult "$i"
sudo systemctl show -p Type,Description,ActiveState,UnitFileState,ConditionResult "$i"
done
elif command -v initctl >/dev/null 2>&1
then
Expand Down
2 changes: 1 addition & 1 deletion ZenPacks/zenoss/LinuxMonitor/zenpack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,7 @@ device_classes:
if command -v systemctl > /dev/null 2>&1
then
echo SYSTEMD
systemctl list-units --all --type=service --plain --full --no-page --no-legend
sudo systemctl list-units --all --type=service --plain --full --no-page --no-legend
else
echo UNKNOWN
exit 127
Expand Down