![]() ![]() #Send response to PRTG that the restart was successfully If (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 )) Wget -O/dev/null "$prtghost/$identtoken?content=$service status0Service: $service is down, but will restart!" #Send response to PRTG that the service is not started. ![]() Wget -O/dev/null "$prtghost/$identtoken?content=$service status1Service: $service is running!" #Send response to PRTG that the service is running. ![]() If (( $(pgrep -x $service | wc -l) > 0 )) #Enter the Identification Token of the HTTP Push Data Advanced sensor. #Enter the server address of your PRTG, including HTTPS/HTTP and the sensor port. #The script also tries to restart the service if it is not started. #This script checks if a certain service is running. Save the following script on the target system, where it can be executed by CRON.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |