How to monitor Zimbra using pflogsumm and NET-SNMP-EXTEND

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
User avatar
jorgedlcruz
Zimbra Alumni
Zimbra Alumni
Posts: 2782
Joined: Thu May 22, 2014 4:47 pm

How to monitor Zimbra using pflogsumm and NET-SNMP-EXTEND

Post by jorgedlcruz »

Hello everyone,
I've been working on a spare project using SNMP and Zimbra Collaboration. This project uses a modified version of the popular pflogsumm script to retrieve the Zimbra Collaboration email queues information and creates an output which we retrieve using the NET-SNMP-EXTEND, so we can monitor each sensor as an SNMP OID.

UPDATED

More information available in: https://github.com/jorgedlcruz/zimbra-n ... -extension

With this project you can monitor multiple things of a Zimbra Platform, fro example the Zimbra mail queues using the SNMP tool you prefer.

Zimbra Collaboration Performance
* Received Megabytes
* Delivered Megabytes
* Total Emails/received
* Total Emails/Delivered
* Total Recipients
* Total Senders
* Forwarded
* Deferred
* Bounced
* Rejected
* Held
* Discarded
* Domains Receiving Emails
* Domains Sending Emails

Also, and brand new, you can now monitor the service status, Version, License and License valid until:
These Scripts combine allow us to monitor from our Zimbra Collaboration:
* Zimbra Version
* Amavis Status
* Antispam Status
* Antivirus Status
* Convertd Status
* LDAP Status
* Logger Status
* Mailboxd Status
* Memcache Status
* MTA Status
* OpenDKIM Status
* Proxy Status
* Service Web App Status
* SNMP Status
* Spell Status
* Stats Status
* Zimbra Web App Status
* Zimbra Web Admin Web App Status
* Zimbra Configd Status
* Zimbra License Status
* Zimbra License valid until Status

Here are an example of how it might look like with PRTG and the Zimbra queues:
Image

And this one just for Resources and Service and License status:
Image

Coming next
This is just a v0.1 of this Dashboard, the next step will be to use the Zimbra SOAP API to obtain some extra information from the Zimbra Collaboration Environment, like:
* Number of Active Users
* Number of Inactive Users
* Number of Domains
* Number of Users with ActiveSync
* etc.

In next versions we will parse directly the logs and put the attempts of logins, and successful logins on a map.

As this is an open project, please feel free to share your ideas, feedback and if possible even help to make it better :) My MTA is really small, so I will appreciate a real feedback from a bigger MTA.

Thank you guys!
Jorge de la Cruz https://jorgedelacruz.es
Systems Engineer at Veeam Software https://www.veeam.com/
User avatar
jorgedlcruz
Zimbra Alumni
Zimbra Alumni
Posts: 2782
Joined: Thu May 22, 2014 4:47 pm

Re: How to monitor Zimbra using pflogsumm and NET-SNMP-EXTEND

Post by jorgedlcruz »

Heads up!
The github project have been updated with a new set of scripts to monitor using SNMP: Zimbra version, Zimbra License and Zimbra services.

Enjoy!

PS: The project is a Community contribution, this means is not supported officialy by Zimbra, just play with it on a staging or test environment.
Jorge de la Cruz https://jorgedelacruz.es
Systems Engineer at Veeam Software https://www.veeam.com/
BloodyIron
Advanced member
Advanced member
Posts: 67
Joined: Sat Sep 13, 2014 2:58 am
Contact:

Re: How to monitor Zimbra using pflogsumm and NET-SNMP-EXTEND

Post by BloodyIron »

While I'm loving these built-in metrics, I really do want to see SNMP actually working in Zimbra OSE too. I effectively want both! Namely so that I can have my existing monitoring (LibreNMS) monitor Zimbra for stability and things like that. But the graph stuff you've been showing in this and the other thread would be super useful for realtime-ish troubleshooting too!

So, perhaps lump fixing SNMP into this too? And having documentation for how to use it? ;) (maybe you recall me discussing this with you in the past).
User avatar
jorgedlcruz
Zimbra Alumni
Zimbra Alumni
Posts: 2782
Joined: Thu May 22, 2014 4:47 pm

Re: How to monitor Zimbra using pflogsumm and NET-SNMP-EXTEND

Post by jorgedlcruz »

Hello!
Thank you for the comment! I remember our conversation, this works as well on Zimbra OSE :) All the instructions to make it work, and even extend it are here: This gives you SNMP itself, which you can monitor with PRTG, LibreNMS or any other SNMP tool.

But I agree, I would love to see the SNMP Zimbra service extended more with this and with other stuff as well

Try it and let us know!

Cheers
Jorge de la Cruz https://jorgedelacruz.es
Systems Engineer at Veeam Software https://www.veeam.com/
jepy
Posts: 2
Joined: Thu Oct 11, 2018 7:01 am

Re: How to monitor Zimbra using pflogsumm and NET-SNMP-EXTEND

Post by jepy »

1. how do I change the default snmp timeout? can I receive the tutorial to change the default snmp timeout via command line linux I use centos 7
2. the problem that I found is that when using a mail queue script in the snmp.conf the data cannot be retrieved, but if it doesn't use the mail queue script, only the script service can
3. if I don't use queue mail, but when I install the mailqueue script I can't

Thanks,
Attachments
if not include zimbra script mail queue.JPG
if not include zimbra script mail queue.JPG (56.04 KiB) Viewed 65889 times
pflogsum2.JPG
pflogsum2.JPG (16.8 KiB) Viewed 65889 times
pflogsum.JPG
pflogsum.JPG (381.02 KiB) Viewed 65889 times
486dx
Posts: 2
Joined: Sat Dec 08, 2018 8:39 am

Re: How to monitor Zimbra using pflogsumm and NET-SNMP-EXTEND

Post by 486dx »

Hello jorgedlcruz,
You did a really great application. With this we can monitor almost all critical metrics that generated from zimbra. I'll try it with Zabbix.
jepy
Posts: 2
Joined: Thu Oct 11, 2018 7:01 am

Re: How to monitor Zimbra using pflogsumm and NET-SNMP-EXTEND

Post by jepy »

how fix it ?
Use of uninitialized value in numeric gt (>) at /etc/snmp/scripts/zimbra_pflogsumm-prtg.pl line 1084 is not a valid integer value
Attachments
how fix it ?
how fix it ?
12345.JPG (157.87 KiB) Viewed 62834 times
tonyg
Advanced member
Advanced member
Posts: 51
Joined: Fri Mar 16, 2018 5:25 pm
Location: USA
ZCS/ZD Version: 8.8.12.GA.3794.UBUNTU18.64 FOSS
Contact:

Re: How to monitor Zimbra using pflogsumm and NET-SNMP-EXTEND

Post by tonyg »

I have a small server with low traffic, just for my own sites. But I really want to monitor my ZCS environment and get notified as soon as anything needs attention. I searched this forum for "SNMP" and found almost no info. So thank you very much for your effort on this FOSS.

I looked over the pflogsumm script. I really don't use Perl anymore so I might re-write that. I was more concerned with understanding what metrics are available, and how to get them out - that includes which files have valuable data, and what that data looks like.

I may or may not use PRTG, given the limit of 100 sensors on the freeware. I'm looking around for other freeware, but I don't care much about graphics. I can write my own code to monitor for issues and send notifications based on trigger values.

What I am curious about ... with all of the references to SNMP in Zimbra (and Postfix) can anyone provide a reference that explains exactly what the SNMP server and other processors are? I don't understand what data they are supposed to provide or how they render their data. I don't understand why we need to parse log files if there is SNMP functionality built-in somewhere.

Thanks!!
Lewis-H
Posts: 49
Joined: Wed Jan 01, 2020 11:28 am
Contact:

Re: How to monitor Zimbra using pflogsumm and NET-SNMP-EXTEND

Post by Lewis-H »

snmpwalk -c public -v2c 127.0.0.1 NET-SNMP-EXTEND-MIB::nsExtendOutLine
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraHeld".1 = STRING: 0
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraBounced".1 = STRING: 0
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraSenders".1 = STRING: 1
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraDeferred".1 = STRING: 2
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraReceived".1 = STRING: 1
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraRejected".1 = STRING: 0
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraDelivered".1 = STRING: 3
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraDiscarded".1 = STRING: 0
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraForwarded".1 = STRING: 0
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraRecipients".1 = STRING: 1
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraBytesReceived".1 = STRING: 570
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraRejectWarning".1 = STRING: 0
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraBytesDelivered".1 = STRING: 3827
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraSendingDomains".1 = STRING: 1
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraRecipientDomains".1 = STRING: 1
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraVersion".1 = STRING: 8.7.11 GA
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusMTA".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusLDAP".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusSNMP".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusProxy".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusSpell".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusStats".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusAmavis".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusLogger".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusConfigd".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusLicense".1 = STRING: license is OK
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusAntispam".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusConvertd".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusMailboxd".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusMemcache".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusOpendkim".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusAntivirus".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusLicensevalid".1 = STRING: 20211231170000Z
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusZimbrawebapp".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusServicewebapp".1 = STRING: Running
NET-SNMP-EXTEND-MIB::nsExtendOutLine."ZimbraStatusZimbraadminwebapp".1 = STRING: Running
You might want to translate this NET-SNMP-EXTEND into OIDs, examplefor ZimbraReceived below, you will need to do the same for every field:

snmpwalk -On -v2c -c public 127.0.0.1 NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"ZimbraReceived\"
.1.3.6.1.4.1.8072.1.3.2.3.1.2.14.90.105.109.98.114.97.82.101.99.101.105.118.101.100 = STRING: 3
Now we know the OID of every value, we can move to our preferred SNMP Tool and start monitoring it by using the OID.
Post Reply