Hi!
Im trying to monitor if my shared folder going well like this:
- Clear messages, umount (will use if later), try to mount and check /var/log/messages for errors.
If null = (1)OK, else = (0)BAD
If I run the script manually the zabbix update the item status after some time, if I let the zabbix do all the work, the item never updates
agentd.conf:
UserParameter=fs.check02,/opt/zabbix_scripts/smb2.sh
messages when I manually execute my script
* after doing this the item on zabbix updates
Im trying to monitor if my shared folder going well like this:
- Clear messages, umount (will use if later), try to mount and check /var/log/messages for errors.
If null = (1)OK, else = (0)BAD
If I run the script manually the zabbix update the item status after some time, if I let the zabbix do all the work, the item never updates
Code:
#!/bin/bash DOMAIN=**** LOGIN=***** PWD=**** LOGFILE=/var/log/messages umount /mnt/foz-fs01-pe/ echo -n > /var/log/messages mount -t cifs //****/test /mnt/****/ -o username=$LOGIN,domain=$DOMAIN,password=$PWD RESULT=`cat /var/log/messages` if [ "$RESULT" == "" ]; then echo "1" else echo "0" fi
UserParameter=fs.check02,/opt/zabbix_scripts/smb2.sh
messages when I manually execute my script
* after doing this the item on zabbix updates
Code:
[root@FOZ-ZABBIX-PE zabbix_scripts]# ./smb2.sh 1 [root@FOZ-ZABBIX-PE zabbix_scripts]# ./smb2.sh mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) 0 [root@FOZ-ZABBIX-PE zabbix_scripts]#
Comment