Monitoramento do ponto de montagem Linux

#!/bin/bash

#################################################################
#                Mount Point Monitoring                         #
#                                                               #
# Ultima revisao:    14/03/2019 por César Carvalho              #
#                                                               #
#################################################################

#### Clear File used by Zabbix ####
> /tmp/check_montagem.log
#### Verification that the mount point is OK ####
export MOUNT=//192.168.0.100/backup_oracle
if grep -qs $MOUNT /proc/mounts; then
   echo "ok" > /tmp/check_montagem.log # File used for monitoring by zabbix
else
   # If the directory is not assembling it will assemble
   /sbin/mount.cifs //192.168.0.100/backup_oracle /backup_remoto -o user,username=bkp_oracle,uid=oracle,rw,password=12345678,domain=teste.com
   if grep -qs $MOUNT /proc/mounts; then
      echo "ok" > /tmp/check_montagem.log # File used for monitoring by zabbix else
   else
      echo "erro" > /tmp/check_montagem.log # File used for monitoring by zabbix else
   fi
fi
ShellScript

Leave a Reply

Your email address will not be published. Required fields are marked *

search previous next tag category expand menu location phone mail time cart zoom edit close