[Zabbix] Fixed typos
This commit is contained in:
parent
3edb48e453
commit
c05a0d3ac8
@ -1,27 +1,27 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Find service name from argument
|
# find service name from argument
|
||||||
monitorService=$1
|
monitorService=$1
|
||||||
|
|
||||||
# Check if $monitorService is empty
|
# check if $monitorService is empty
|
||||||
if [ -z "$monitorService" ]; then
|
if [ -z "$monitorService" ]; then
|
||||||
read -p "Please pass me the service name: " monitorService
|
read -p "Please pass me the service name: " monitorService
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Define the check_service function
|
# define the check_service function
|
||||||
function check_service {
|
function check_service {
|
||||||
|
|
||||||
# Check if the service is active and report so
|
# check if the service is active and report so
|
||||||
if systemctl is-active --quiet $monitorService; then
|
if systemctl is-active --quiet $monitorService; then
|
||||||
echo "$monitorService is running"
|
echo "$monitorService is running"
|
||||||
|
|
||||||
# If the service is not running, exit with an error.
|
# if the service is not running, exit with an error.
|
||||||
else
|
else
|
||||||
echo "$monitorService is not running"
|
echo "$monitorService is not running"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Excecute the check_service function
|
# excecute the check_service function
|
||||||
check_service
|
check_service
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Prune container images
|
# prune container images
|
||||||
if [ -x "$(command -v docker)" ]; then
|
if [ -x "$(command -v docker)" ]; then
|
||||||
echo "Pruning using Docker"
|
echo "Pruning using Docker"
|
||||||
sudo docker image prune -af
|
sudo docker image prune -af
|
||||||
@ -14,7 +14,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Remove all disabled snaps
|
# remove all disabled snaps
|
||||||
if [ -x "$(command -v snap)" ]; then
|
if [ -x "$(command -v snap)" ]; then
|
||||||
echo "Remove all deactivated snaps"
|
echo "Remove all deactivated snaps"
|
||||||
sudo snap list --all | \
|
sudo snap list --all | \
|
||||||
@ -27,7 +27,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Flush and rotate all logs
|
# flush and rotate all logs
|
||||||
if [ -x "$(command -v journalctl)" ]; then
|
if [ -x "$(command -v journalctl)" ]; then
|
||||||
echo "Vacuuming logs using journalctl"
|
echo "Vacuuming logs using journalctl"
|
||||||
sudo journalctl \
|
sudo journalctl \
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Clear swapusage
|
# clear swapusage
|
||||||
free_memory=`free -m | awk 'NR==2{print $7}'`
|
free_memory=`free -m | awk 'NR==2{print $7}'`
|
||||||
used_swap=`free -m | awk 'NR==3{print $3}'`
|
used_swap=`free -m | awk 'NR==3{print $3}'`
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user