The proc.c patch adds FreeBSD 8.0+ jail [1] support for the proc.num[] item.
The item takes a fifth parameter as a jail ID or name.
- If the parameter is empty, information about all processes on the server is returned.
- If the parameter contains the name or ID of an existing jail, information about processes inside the jail is returned.
- If the parameter contains 0, information about processes on the host is returned only, processes inside jails are ignored.
This behavior corresponds to the ps (-J option) [2] and sockstat (-j option) [3] utilities.
This patch requires the libjail [4] library, which was introduced in FreeBSD 8.0, so I added a patch to configure.ac that checks for the libjail library. If the library is not found, the fifth parameter of the proc.num[] item is ignored.
[1] https://www.freebsd.org/doc/handbook/jails.html
[2] https://www.freebsd.org/cgi/man.cgi?ps(1)
- part of
-
ZBXNEXT-1711 New key for discovery rule / LLD to collect processes
- Closed