~ubuntu-dev/ubuntu/lucid/zabbix/lucid-201002110857

« back to all changes in this revision

Viewing changes to frontends/php/include/nodes.inc.php

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-06-04 09:22:37 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080604092237-zgwq7kmraj1oohoz
Tags: 1:1.4.5-1ubuntu1
* Merge from debian unstable, remaining changes: 
  + fixing missing pid directory in /var/run
* Added the same patch to debian/zabbix-server-{mysql,pgsql}.zabbix-server.init
  (LP: #172775)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
** along with this program; if not, write to the Free Software
18
18
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
19
**/
20
 
        require_once    "include/db.inc.php";
21
20
?>
22
21
<?php
23
22
        function        detect_node_type($node_data)
25
24
                global $ZBX_CURMASTERID;
26
25
 
27
26
                if($node_data['nodeid'] == get_current_nodeid(false))           $node_type = ZBX_NODE_LOCAL;
28
 
                else if($node_data['nodeid'] == $ZBX_CURMASTERID)               $node_type = ZBX_NODE_MASTER;
29
 
                else if($node_data['masterid'] == get_current_nodeid(false))    $node_type = ZBX_NODE_REMOTE;
 
27
                else if(bccomp($node_data['nodeid'] ,$ZBX_CURMASTERID)==0)              $node_type = ZBX_NODE_MASTER;
 
28
                else if(bccomp($node_data['masterid'], get_current_nodeid(false))==0)   $node_type = ZBX_NODE_REMOTE;
30
29
                else $node_type = -1;
31
30
 
32
31
                return $node_type;