File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -173,11 +173,14 @@ def apply(monitoring):
173
173
# Reload systemd manager configuration
174
174
call ('systemctl daemon-reload' )
175
175
if not monitoring or 'node_exporter' not in monitoring :
176
- call (f'systemctl stop { node_exporter_systemd_service } ' )
176
+ if os .path .isfile (node_exporter_service_file ):
177
+ call (f'systemctl stop { node_exporter_systemd_service } ' )
177
178
if not monitoring or 'frr_exporter' not in monitoring :
178
- call (f'systemctl stop { frr_exporter_systemd_service } ' )
179
+ if os .path .isfile (frr_exporter_service_file ):
180
+ call (f'systemctl stop { frr_exporter_systemd_service } ' )
179
181
if not monitoring or 'blackbox_exporter' not in monitoring :
180
- call (f'systemctl stop { blackbox_exporter_systemd_service } ' )
182
+ if os .path .isfile (blackbox_exporter_service_file ):
183
+ call (f'systemctl stop { blackbox_exporter_systemd_service } ' )
181
184
182
185
if not monitoring :
183
186
return
You can’t perform that action at this time.
0 commit comments