[ZBXNEXT-1031] Get server status thru API Created: 2011 Nov 15  Updated: 2018 Nov 08

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: API (A)
Affects Version/s: 1.8.8, 1.8.9
Fix Version/s: None

Type: New Feature Request Priority: Minor
Reporter: Jordi Clariana Assignee: Alexei Vladishev
Resolution: Unresolved Votes: 10
Labels: check, patch, server
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All enviroments, all OSs, all hardware.


Attachments: File APIServer.patch     File ServerStatus_3_0_1.patch    
Issue Links:
Duplicate
duplicates ZBXNEXT-1079 API call to get system status missing Closed

 Description   

Hi,

It will be nice to have some function in the API to get Zabbix Server status, the same way it is checked in the dashboard (I mean, the fsockopen method).

Thanks.



 Comments   
Comment by Jordi Clariana [ 2012 Oct 14 ]

This patch creates new API call: Server, with 3 methods: version, status and performance.

Feel free to modify and/or include it in the next Zabbix release.

I'll made it based on Zabbix version 2, I have it for version 1.8 too if anyone interested.

Regards.

Comment by Jordi Clariana [ 2013 Apr 19 ]

Hi,

I wonder if there's any plan to implement this patch on the main branch. Can you tell me?

Thanks.

Comment by richlv [ 2013 Apr 19 ]

it's not on the roadmap currently (but i like it & voted on it )

Comment by sxc7541 [ 2016 Feb 25 ]

I've written a Python script to monitor the Zabbix server externally (make sure it's running) - details here: http://serverfault.com/questions/741064/monitoring-zabbix-server-itself-externally/760343#760343

Alas, I've noticed that the Zabbix server somehow continues to respond to API requests even if it's stopped... I suppose this feature would help in this scenario.

Thanks to @Jordiclariana for providing a full fledged patch. Now if only this could make it into an official release...

Comment by sxc7541 [ 2016 Mar 25 ]

For others like me still waiting for this functionality to be incorporated in an official release, here's Jordi's patch adapted to run on Zabbix 3.0(.1): ServerStatus_3_0_1.patch

Comment by yuanpeng [ 2017 May 17 ]

I think you can do some improvement for 'server.status' function, when zabbix_server becomes zombie, connection to 'ZBX_SERVER_PORT' may still be successful. So maybe you can send some request to the opened stream, and set stream timeout, if fwrite request time out, then return status failed

Comment by Adrian Kirchner [ 2018 Nov 08 ]

This would be very helpful. Sometimes (a few times per year) we have situations where most of the zabbix server processes are killed (eg. by OOM through neighbor processes) and doesn't collect values but it still responds on port 10051. This situation is very hard to monitor with tools like Pingdom.

Please provide an API endpoint which utilizes the same fsockopen method as the dashbord widget is using.

Generated at Wed Apr 24 21:38:02 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.