User Tools

Site Tools


check_service_and_restart_if_failed

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
check_service_and_restart_if_failed [2020/07/27 03:32] k2patelcheck_service_and_restart_if_failed [2020/08/10 02:35] (current) – external edit 127.0.0.1
Line 22: Line 22:
 #!/usr/bin/env python3 #!/usr/bin/env python3
 import os import os
-import sys 
 import logging import logging
 from systemd import journal from systemd import journal
Line 47: Line 46:
  
   # Define service array   # Define service array
-  serviceName = 'nginx+  serviceName = ["nginx"] 
- +  for service in serviceName: 
-  main(serviceName)+    main(service)
 </code> </code>
check_service_and_restart_if_failed.1595820772.txt.gz · Last modified: 2020/08/10 02:28 (external edit)