Ad Widget

Collapse

PATCH: Improve Server Status In Reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #1

    PATCH: Improve Server Status In Reports

    Greetings,

    The attached patch is designed to improve the method used by the web interface to determine if the Zabbix Server is up. Currently, the web interface uses ps, which works well enough if you run the web server on the same machine as the Zabbix server, however, if you run them on seperate systems, the report will always show the server is down. Instead, this patch uses zabbix_get to query a zabbix agent running on the same server that is running the Zabbix Server to determine if the Zabbix server is running. As such this can be used locally or remotely.

    Additionally, this patch gives a new option that will show the Zabbix Server status on each page.

    After applying the patch, there will be a new file in the Zabbix web directory called include/server.inc.php. In this file, you will find the following configuration options;
    • $zabbixServer["display"] -- This defaults to 0, which tells the web interface not to display server status on each page. If se to 1, it will show the status at the top of each page.
    • $zabbixServer["host"] -- This defaults to localhost and is used to tell the web interface which server the Zabbix Server is running on.
    • $zabbixServer["port"] -- This defaults to 10050 and indicates what port the zabbix_get tool is supposed to connect to the query the agent running on the Zabbix Server.
    • $zabbixServer["zabbix_get"] -- This defaults to /usr/sbin/zabbix_get and is the location of the zabbix_get tool on the zabbix web interface server.


    After editing your configuration, you will need to alter the zabbix_agentd.conf file on the zabbix server to allow the server that the web interface is running on to query it.

    In my test environment at home, I run the Zabbix Server on a server called zabbix.test.testorg and the web server on www.test.testorg. I run the zabbix_agentd on the default port of 10050, and I installed the zabbix_get on the web server in /usr/sbin. I use the following configuration;
    [code]
    $zabbixServer["display"] =1;
    $zabbixServer["host"] ="zabbix.test.testorg";
    $zabbixServer["port"] ="10050";
    $zabbixServer["zabbix_get"] ="/usr/sbin/zabbix_get";[/list]

    From there, I edited the zabbix_agentd.conf file on zabbix.test.testorg and modified the server line. Originally this line was;
    Code:
    Server=127.0.0.1
    I changed it to;
    Code:
    Server=127.0.0.1,www.test.testorg
    EDIT: PS, I have added this to the patch I am building for submission to the CVS for 1.1.3. Sorry. I forgot the forums do now allow gzip packages.
    Attached Files
    Last edited by James Wells; 19-09-2006, 21:17.
    Unofficial Zabbix Developer
Working...