Deprecated: Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Cookie/Jar.php on line 63

Deprecated: Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Cookie/Jar.php on line 73

Deprecated: Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Cookie/Jar.php on line 89

Deprecated: Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Cookie/Jar.php on line 102

Deprecated: Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Cookie/Jar.php on line 111

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 51

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 82

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/webvol14/so/emm9jypq7227iqw/linuxkitchen.com/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 91
Zabbix i praćenje Sendmail mailq-a – Linux, Windows, Heklanje, Kuhinja

Dakle “Template Linux Server” ili bilo koji drugi Zabbix template ne daje opciju praćenja veličine mailq-a na Sendmail mail serveru.
Kako to da postignem?

Neophodni početni uslovi
Host mašina (mail server) MORA da na sebi ima Zabbix agenta instaliranog, i da on radi.
Zabbix server mora da “vidi” Zabbix agenta na datom serveru (slovo “Z” na datom hostu mora biti zeleno).

Šta sve treba uraditi na host mašini
a. Nalogu zabbix moramo dati root prava jer to zahteva mailq naredba. Dakle u fajlu /etc/sudoers unesemo sledeće :
*****
Defaults:zabbix !requiretty
zabbix ALL=NOPASSWD:/usr/bin/mailq
*****
b. U folderu /etc/zabbix napraviti skriptu koja kao izlaz daje veličinu mailq-a :
-rwxr-xr-x 1 zabbix zabbix 154 Sep 15 12:57 mejlkju
*****
#!/bin/sh
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
mejlkju=`sudo mailq | tail -n1 | awk ‘{print $3}’`
echo $mejlkju
*****
c. U konfiguraciji Zabbix agenta, na kraj u /etc/zabbix_agentd.conf dodati :
EnableRemoteCommands=1
UserParameter=sendmail.mailq,/etc/zabbix/mejlkju
Restartovati zabbix agenta :
# service zabbix-agent restart
Napomena : ako je u pitanju stari zabbix agent (1.4.5 ili 1.4.6) raditi sve isto kao i za noviju verziju, i menjati isti zabbix_agentd.conf fajl.
d. Takođe nalogu zabbix u /etc/passwd staviti da mu je HOME folder tamo gde smo stavili skriptu (u našem slučaju to je /etc/zabbix) :
zabbix:x:492:488:Zabbix Monitoring System:/etc/zabbix:/bin/bash
Testirati skriptu :
# su – zabbix
-bash-4.1$ ./mejlkju
0
Posle ovog testa OBAVEZNO vratiti shell za zabbix korisnika na /sbin/nologin!!

Šta treba uraditi na strani Zabbix servera
Napraviti novi “Item” pod serverom čiji mailq želimo da pratimo.
Za dati Item staviti sledeće karakteristike :
Name – sendmail.mailq
Key – sendmail.mailq
Type – zabbix agent
Type of information – numeric (unsigned)
Applications – General

Provera rada
Na host serveru pratiti /var/log/zabbix/zabbix_agent.log
Na Zabbix serveru pratiti – Monitoring/Latest data/pretražiti po nazivu “sendmailmailq”

Prilično koristan link.

By velda