[ZBXNEXT-4534] make system.users.num item return the number of distinct users Created: 2018 May 02 Updated: 2019 Nov 13 |
|
Status: | Open |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Agent (G) |
Affects Version/s: | 3.4.8 |
Fix Version/s: | None |
Type: | Change Request | Priority: | Minor |
Reporter: | Aleksandrs Saveljevs | Assignee: | Vladislavs Sokurenko |
Resolution: | Unresolved | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: | ZBXNEXT-4534.diff |
Description |
Currently, the system.users.num item returns the number of sessions, counting the number of lines in the output of who: $ who asaveljevs pts/0 2018-03-29 16:26 (:0) asaveljevs pts/1 2018-03-29 16:26 (:0) asaveljevs pts/3 2018-03-29 16:44 (:0:S.0) asaveljevs pts/4 2018-03-29 16:44 (:0:S.1) asaveljevs pts/5 2018-04-03 12:57 (:0:S.2) asaveljevs pts/6 2018-04-04 12:07 (:0:S.3) asaveljevs pts/7 2018-04-04 12:08 (:0:S.4) asaveljevs pts/8 2018-04-05 11:59 (:0:S.5) asaveljevs pts/9 2018-04-20 13:13 (:0:S.6) asaveljevs pts/10 2018-04-20 14:00 (:0:S.7) asaveljevs pts/11 2018-04-27 14:26 (:0:S.8) $ who | wc -l 11 $ zabbix_agentd -t system.users.num system.users.num [u|11] This is nice, but in reality there is just one user logged in. Similarly, if a single user (Alice) establishes two SSH sessions to a server, system.users.num will return 2. Perhaps this can be solved by adding a parameter to system.users.num to choose between the current behavior and the number of distinct users. There may be a similar need to monitor whether a particular user is logged in. For instance, Alice may want to monitor if Bob is logged on to a server for a long time. |
Comments |
Comment by Vladislavs Sokurenko [ 2019 Nov 11 ] |
Attached patch with possible solution ZBXNEXT-4534.diff |