diff options
Diffstat (limited to 'frontends/php/include/nodes.inc.php')
-rw-r--r-- | frontends/php/include/nodes.inc.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/frontends/php/include/nodes.inc.php b/frontends/php/include/nodes.inc.php index b8e14035..19987371 100644 --- a/frontends/php/include/nodes.inc.php +++ b/frontends/php/include/nodes.inc.php @@ -22,11 +22,11 @@ <?php function detect_node_type($node_data) { - global $ZBX_CURNODEID, $ZBX_CURMASTERID; + global $ZBX_CURMASTERID; - if($node_data['nodeid'] == $ZBX_CURNODEID) $node_type = ZBX_NODE_LOCAL; - else if($node_data['nodeid'] == $ZBX_CURMASTERID) $node_type = ZBX_NODE_MASTER; - else if($node_data['masterid'] == $ZBX_CURNODEID) $node_type = ZBX_NODE_REMOTE; + if($node_data['nodeid'] == get_current_nodeid(false)) $node_type = ZBX_NODE_LOCAL; + else if($node_data['nodeid'] == $ZBX_CURMASTERID) $node_type = ZBX_NODE_MASTER; + else if($node_data['masterid'] == get_current_nodeid(false)) $node_type = ZBX_NODE_REMOTE; else $node_type = -1; return $node_type; @@ -48,7 +48,7 @@ function add_node($new_nodeid,$name,$timezone,$ip,$port,$slave_history,$slave_trends,$node_type) { - global $ZBX_CURNODEID, $ZBX_CURMASTERID; + global $ZBX_CURMASTERID; if( !eregi('^'.ZBX_EREG_NODE_FORMAT.'$', $name) ) { @@ -59,7 +59,7 @@ switch($node_type) { case ZBX_NODE_REMOTE: - $masterid = $ZBX_CURNODEID; + $masterid = get_current_nodeid(false); $nodetype = 0; break; case ZBX_NODE_MASTER: @@ -94,7 +94,7 @@ if($result && $node_type == ZBX_NODE_MASTER) { - DBexecute('update nodes set masterid='.$new_nodeid.' where nodeid='.$ZBX_CURNODEID); + DBexecute('update nodes set masterid='.$new_nodeid.' where nodeid='.get_current_nodeid(false)); $ZBX_CURMASTERID = $new_nodeid; /* applay Master node for this script */ } |