Zabbix scripts

Internet full cycle tests
UserParameter=inet.fullcycle.noproxy,wget --no-cache --no-proxy -qO- https://yandex.ru | grep -c "Яндекс"
UserParameter=inet.fullcycle.wproxy,wget --no-cache -e use_proxy=yes -e https_proxy=192.168.0.253:3128 -qO- https://yandex.ru | grep -c "Яндекс"
EMail full cycle tests
#!/bin/bash

# curl version >7.33 needed !!!

### crontab
# */5 * * * * root /etc/zabbix/bin/mail.local.fullcycle.check.sh

### zabbix
# UserParameter=mail.local.fullcycle.test,cat /tmp/mail-fullcycle-test.status

KEYTEXT="LOCAL-MTA-FULL-CYCLE-TEST-"`date`
USER="[email protected]"
PASSWORD="P%40ssw0rd"
SERVER="mail.yourserver.local"
MAILADDR="[email protected]"

# send email
echo "$KEYTEXT" | mail -s "zabbix test mail" $MAILADDR

# cleanup sent mail
curl --silent --url imap://$USER:[email protected]$SERVER/Sent -X "STORE 1 +Flags \Deleted"
curl --silent --url imap://$USER:[email protected]$SERVER/Sent -X "EXPUNGE"

# wait a little
sleep 30

# check email and write status
curl --silent --url "imap://$USER:[email protected]$SERVER/INBOX;UID=1" | grep -c "$KEYTEXT" > /tmp/mail-fullcycle-test.status

# cleanup inbox
curl --silent --url imap://$USER:[email protected]$SERVER/INBOX -X "STORE 1 +Flags \Deleted"
curl --silent --url imap://$USER:[email protected]$SERVER/INBOX -X "STORE 2 +Flags \Deleted"
curl --silent --url imap://$USER:[email protected]$SERVER/INBOX -X "STORE 3 +Flags \Deleted"
curl --silent --url imap://$USER:[email protected]$SERVER/INBOX -X "STORE 4 +Flags \Deleted"
curl --silent --url imap://$USER:[email protected]$SERVER/INBOX -X "STORE 5 +Flags \Deleted"
curl --silent --url imap://$USER:[email protected]$SERVER/INBOX -X "EXPUNGE"

exit 0