Iulix Dim
Iulix Dim

Reputation: 37

How can I obtain the ip of the user which logged in, via zabbix api

Via Zabbix API using method "user.get" I can obtain the IP of the last user that failed to log in:

{
   "userid":"4",
   "alias":"xxxxxx",
   "name":"xxxxxxxxx",
   "surname":"xxxxx",
   "url":"",
   "autologin":"0",
   "autologout":"0",
   "lang":"en_GB",
   "refresh":"30s",
   "type":"3",
   "theme":"default",
   "attempt_failed":"1",
   "attempt_ip":"172.0.0.1",
   "attempt_clock":"1530779445",
   "rows_per_page":"50",
    "gui_access":"0",
    "debug_mode":"0",
    "users_status":"0",
    "medias":[ ]
},

Is there a method by which I could get the IP of the successfully logged in user?

Like in Zabbix Reports->audit

Upvotes: 0

Views: 406

Answers (1)

Iulix Dim
Iulix Dim

Reputation: 37

I found a solution to my question.

The solution is to use method user.login with parameter: userData: true, and in the result is userip response parameter which contains the user IP address.

Upvotes: 0

Related Questions