yetopen / zabbix-scripts Goto Github PK
View Code? Open in Web Editor NEWMy Zabbix template and scripts
My Zabbix template and scripts
The discovery script generates bad JSON on Ubuntu 14:
# ./zbx_zimbra.sh discover
{
-e "data":[
Changing the shell to /bin/bash makes it work correctly:
root@zimbra:~/zabbix-scripts/zabbix-zimbra# diff -u zbx_zimbra.sh /etc/zabbix/scripts/zbx_zimbra.sh
--- zbx_zimbra.sh 2016-03-29 22:16:55.355327161 +0000
+++ /etc/zabbix/scripts/zbx_zimbra.sh 2016-03-30 17:59:51.107397777 +0000
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
Thanks
I you have a server named svxxldap01
The check for ldap fails because the file where you save the service status includes in the first line the server name.
Hello, Im using the latest version of this script however Im getting the discovery error in Zabbix "Value should be a JSON object".
Zabbix Server 3.2, centos 7
Output from Zimbra node:
[root@mail ~]# /etc/zabbix/scripts/zbx_zimbra.sh version
Release 8.6.0_GA_1153.RHEL6_64_20141215151155 RHEL6_64 FOSS edition, Patch 8.6.0_P7.
[root@mail ~]# /etc/zabbix/scripts/zbx_zimbra.sh discover
{
"data":[
{ "{#ZIMBRASERVICE}":"amavis" }, { "{#ZIMBRASERVICE}":"antispam" }, { "{#ZIMBRASERVICE}":"antivirus" }, { "{#ZIMBRASERVICE}":"ldap" }, { "{#ZIMBRASERVICE}":"logger" }, { "{#ZIMBRASERVICE}":"mailbox" }, { "{#ZIMBRASERVICE}":"memcached" }, { "{#ZIMBRASERVICE}":"mta" }, { "{#ZIMBRASERVICE}":"opendkim" }, { "{#ZIMBRASERVICE}":"proxy" }, { "{#ZIMBRASERVICE}":"service webapp" }, { "{#ZIMBRASERVICE}":"snmp" }, { "{#ZIMBRASERVICE}":"spell" }, { "{#ZIMBRASERVICE}":"stats" }, { "{#ZIMBRASERVICE}":"zimbra webapp" }, { "{#ZIMBRASERVICE}":"zimbraAdmin webapp" }, { "{#ZIMBRASERVICE}":"zimlet webapp" }, { "{#ZIMBRASERVICE}":"zmconfigd" }
]
}
[root@mail ~]# /etc/zabbix/scripts/zbx_zimbra.sh amavis
1
I also tested the above json on https://jsonlint.com/ and it confirms to be valid. However discovery fails in Zabbix.
Please advise how I can fix this.
Thanks.
In Centos 7, mailq was in different directory, maybe you can mention that in readme :) I used locate to find it.
/opt/zimbra/postfix-2.11.1.2z/sbin/mailq
I get this error ?
[root@newmail ~]# systemctl start httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
I have installed everything according to this
https://www.zabbix.com/download?zabbix=4.2&os_distribution=centos&os_version=7&db=postgresql
I assume its an HTTPD port issue ?
After i installed the scripts on our zimbra server and configured them, i had the following issue: the json file was wrongly parsed to the zabbix server and i fixed the json to a static file.
After this, the services get discovered on the zabbix server but it couldn't retreive all the data. It tries to pull the data through the passive agent, but it keeps generating errors and won't retrieve all the data. From the 18 services it can only find 12 on start from the zabbix agent and it can only sync 4 services
code from the error log on the zabbix server(debug level 3):
8582:20161105:174049.096 Zabbix agent item "zimbra.status[amavis]" on host "mail.phasehosting.io" failed: first network error, wait for 15 seconds 8590:20161105:174104.321 resuming Zabbix agent checks on host "mail.phasehosting.io": connection restored
this keeps repeating every 2 mins, like the item interval is configured.
in zabbix on the latest data following appears(its visible only couple services gets checked):
I tried changing the pollers and discoverers on the server and agent listerners on the agent to higher values, without effect.I tried changing the timeout value in the zabbix_agentd.d/yo-zimbra.conf file without effect. I also tried to change timeout values in server and agent files but due i am new to zabbix i don't know which has the most effect.
The correct path for yo-zimbra.conf seems to be /etc/zabbix/zabbix_agentd.d/
Hi
Currently trying out the script, im not sure if i did this part correctly,
Added the conf into the sudoers folder
running ubuntu 18.04
cp sudo_zbx-zimbra.conf /etc/sudoers.d/
But im getting this error
Invalid discovery rule value: cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'sudo: no tty present and no askpass program specified'
Thank you
sudo_zbx-zimbra.conf won't work with extension .conf. At least in Centos 7.
And it need to be created like that "sudo visudo -f /etc/sudoers.d/sudo_zbx-zimbra", so it will be created with correct permissions. You can update readme :)
And i changed "Cmnd_Alias ZIMBRA_BIN_ZABBIX = /opt/zimbra/bin/zmcontrol status, /opt/zimbra/bin/zmcontrol -v" line, that it cant stop services accidentally.
From manual:
sudo will read each file in /etc/sudoers.d, skipping file names that end in ‘~’ or contain a ‘.’ character to avoid causing problems with package manager or editor temporary/backup files.
Hi, first thanks for the script.
I Installed the script, the version is reported to Zabbix but the discovery are not working and I get the error "value should be a json object"
When I execute the script /etc/zabbix/scripts/zbx_zimbra.sh discover I get:
{
-e "data":[
{ "{#ZIMBRASERVICE}":"amavis" },
{ "{#ZIMBRASERVICE}":"antispam" },
{ "{#ZIMBRASERVICE}":"antivirus" },
{ "{#ZIMBRASERVICE}":"dnscache" },
{ "{#ZIMBRASERVICE}":"memcached" },
{ "{#ZIMBRASERVICE}":"mta" },
{ "{#ZIMBRASERVICE}":"opendkim" },
{ "{#ZIMBRASERVICE}":"proxy" },
{ "{#ZIMBRASERVICE}":"snmp" },
{ "{#ZIMBRASERVICE}":"stats" }
-e
]
}
Hi,
Discover with error.
After update:
{
\t"data":[\n
{ "{#ZIMBRASERVICE}":"amavis" }, { "{#ZIMBRASERVICE}":"ldap" }, { "{#ZIMBRASERVICE}":"logger" }, { "{#ZIMBRASERVICE}":"mailbox" }, { "{#ZIMBRASERVICE}":"mta" }, { "{#ZIMBRASERVICE}":"service webapp" }, { "{#ZIMBRASERVICE}":"snmp" }, { "{#ZIMBRASERVICE}":"spell" }, { "{#ZIMBRASERVICE}":"stats" }, { "{#ZIMBRASERVICE}":"zimbra webapp" }, { "{#ZIMBRASERVICE}":"zimbraAdmin webapp" }, { "{#ZIMBRASERVICE}":"zimlet webapp" }, { "{#ZIMBRASERVICE}":"zmconfigd" }
\n\t]\n
}
Before:
{
"data":[
{ "{#ZIMBRASERVICE}":"amavis" }, { "{#ZIMBRASERVICE}":"ldap" }, { "{#ZIMBRASERVICE}":"logger" }, { "{#ZIMBRASERVICE}":"mailbox" }, { "{#ZIMBRASERVICE}":"mta" }, { "{#ZIMBRASERVICE}":"service webapp" }, { "{#ZIMBRASERVICE}":"snmp" }, { "{#ZIMBRASERVICE}":"spell" }, { "{#ZIMBRASERVICE}":"stats" }, { "{#ZIMBRASERVICE}":"zimbra webapp" }, { "{#ZIMBRASERVICE}":"zimbraAdmin webapp" }, { "{#ZIMBRASERVICE}":"zimlet webapp" }, { "{#ZIMBRASERVICE}":"zmconfigd" }
]
}
thanks,
Jhones Petter
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.