监控glusterfs

时间:2023-03-08 17:02:52

监控集群状态

[4ajr@elk1 scripts]$ cat glusterfs_peer_status.sh

#!/bin/bash

peer_status=`sudo gluster peer status |  grep State | uniq`

if [ "State: Peer in Cluster (Connected)" = "$peer_status" ]

then

echo "1"

else

echo "0"

fi

UserParameter=status_gluster,bash /soft/zabbix_agent/scripts/glusterfs_peer_status.sh

监控端口

[4ajr@elk1 scripts]$ cat glusterfs_port_listen.sh

#!/bin/bash

port=`ss -ant | grep LISTEN | grep 49153 | awk '{print $4}' | awk -F : '{print $2}'`

if [ $port -eq 49153 ]

then

echo 1

else

echo 0

fi

UserParameter=port_gluster,bash /soft/zabbix_agent/scripts/glusterfs_port_listen.sh