-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix /proc/mounts parsing & eliminate debug log noise #80
Fix /proc/mounts parsing & eliminate debug log noise #80
Conversation
Hi Ross, Thank you for your PR 👍 . It needs some testing first. 1.) zbx_regexp_sub() 2.) /proc/mounts 3.) zbx_module_history_write_cbs |
Hi, thanks for the feedback!
|
2.) I'm building my own Gentoo for testing. It's good idea to have some VM with 4.9 kernel. Usually I work with older kernels, so probably that's a reason why I didn't see this problem before. I need to test it also with older kernels, which are used by majority distros. 3.) Yes, it's optional and that message is not error, it's only debug/info. Zabbix dev:
Could you remove |
The string functions were failing to catch some variations in /proc/mounts formatting.
19f54b5
to
1573425
Compare
Just removed the |
Sorry for a delay. LGTM. CentOS test:
Gento test:
And thank you again. |
/proc/mounts
depended on certain words and spaces that are not present in every *nix distro, so I rewrote usingzbx_regexp_sub()
to a more generic regex. (n.b. It would have been simpler to usestrtok()
, but I wasn't sure whether thread-safety was required in this context. I stuck to Zabbix library functions to ensure I didn't introduce any conflicts, and there is no string tokenizer that I could find in the Zabbix library.)zbx_module_history_write_cbs(void)
to the module, as I was seeing errors in the log at DebugLevel=4. The Zabbix docs for module creators don't say that this function is optional, so I went ahead and implemented it as returning all NULL values in case it becomes a hard requirement in future versions.