jorgedlcruz / zimbra-grafana

How to monitor a Zimbra Collaboration Environment using pflogsumm, Telegraf, InfluxDB and Grafana
MIT License
46 stars 31 forks source link

Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl #2

Closed mvhconsult closed 6 years ago

mvhconsult commented 6 years ago

After running for the first time. Is the indexing correct?

/opt/zimbra/common/bin# sudo -u telegraf /opt/zimbra/common/bin/zimbra_pflogsumm.pl /var/log/zimbra.log Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 946, <> line 109972. zimbra-stats received=6512 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 947, <> line 109972. zimbra-stats delivered=13038 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 948, <> line 109972. zimbra-stats forwarded=0 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 949, <> line 109972. zimbra-stats deferred=0 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 950, <> line 109972. zimbra-stats bounced=2 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 951, <> line 109972. zimbra-stats rejected=0 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 952, <> line 109972. zimbra-stats reject_warnings=0 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 953, <> line 109972. zimbra-stats held=0 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 954, <> line 109972. zimbra-stats discarded=0 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 955, <> line 109972. zimbra-stats bytes_received=2957 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 956, <> line 109972. zimbra-stats bytes_delivered=10087 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 957, <> line 109972. zimbra-stats senders=2 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 958, <> line 109972. zimbra-stats sending_hosts_domains=1 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 959, <> line 109972. zimbra-stats recipients=2 Redundant argument in printf at /opt/zimbra/common/bin/zimbra_pflogsumm.pl line 960, <> line 109972.

jorgedlcruz commented 6 years ago

Umh, that didn't happen to me, which Os are you at?

thanks for reporting it

mvhconsult commented 6 years ago

I'm doing this on fresh install on Ubuntu 16.04.3 LTS It's a recurring issue. Server is not live, so no idea what the real numbers would be.

jcasamitjana commented 6 years ago

I had the same problem. The function adj_int_units returns two vars, so I changed from line 946 to 964 adding a new %s after %d and I solved the problem in Ubuntu 16.04:

printf "zimbra-stats received=%d%s\n", adj_int_units($msgsRcvd);
printf "zimbra-stats delivered=%d%s\n", adj_int_units($msgsDlvrd);
printf "zimbra-stats forwarded=%d%s\n", adj_int_units($msgsFwdd);
printf "zimbra-stats deferred=%d%s\n", adj_int_units($msgsDfrd);
printf "zimbra-stats bounced=%d%s\n", adj_int_units($msgsBncd);
printf "zimbra-stats rejected=%d%s\n", adj_int_units($msgsRjctd);
printf "zimbra-stats reject_warnings=%d%s\n", adj_int_units($msgsWrnd);
printf "zimbra-stats held=%d%s\n", adj_int_units($msgsHld);
printf "zimbra-stats discarded=%d%s\n", adj_int_units($msgsDscrdd);
printf "zimbra-stats bytes_received=%d%s\n", adj_int_units($sizeRcvd);
printf "zimbra-stats bytes_delivered=%d%s\n", adj_int_units($sizeDlvrd);
printf "zimbra-stats senders=%d%s\n", adj_int_units($sendgUserCnt);
printf "zimbra-stats sending_hosts_domains=%d%s\n", adj_int_units($sendgDomCnt);
printf "zimbra-stats recipients=%d%s\n", adj_int_units($recipUserCnt);
printf "zimbra-stats recipient_hosts_domains=%d%s\n", adj_int_units($recipDomCnt);

if(defined($opts{'smtpdStats'})) {
    printf "zimbra-stats connections=%d%s\n", adj_int_units($smtpdConnCnt);
    printf "zimbra-stats hosts_domains=%d%s\n", adj_int_units(int(keys %smtpdPerDom));
}
mvhconsult commented 6 years ago

Just tested, and works well. I don't have earlier version at hand, so maybe this should be in a version controlled if statement?

jorgedlcruz commented 6 years ago

I've added it to the script, so now it does include your fix, thank you so much!

olegsidokhmetov commented 4 years ago

Hello!

I can download this file use this link https://raw.githubusercontent.com/jorgedlcruz/zimbra-grafana/master/zimbra_pflogsumm.pl

I try to use this manual https://wiki.zimbra.com/wiki/Monitoring_ZimbraCollaboration-_InfluxDB,_Telegraf_and_Grafana

jorgedlcruz commented 4 years ago

Hello, those steps are not valid anymore, and you should use only these steps https://github.com/jorgedlcruz/zimbra-grafana

olegsidokhmetov commented 4 years ago

Hello, those steps are not valid anymore, and you should use only these steps https://github.com/jorgedlcruz/zimbra-grafana

Perfect, I see!