Changeset 748 for branches/0.4/web/addons/job_monarch/libtoga.php
- Timestamp:
- 03/25/13 17:58:46 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.4/web/addons/job_monarch/libtoga.php
r747 r748 537 537 $error = sprintf( 'XML error: %s at %d', xml_error_string( xml_get_error_code( $this->parser ) ), xml_get_current_line_number( $this->parser ) ); 538 538 } 539 $handler = &$this->xmlhandler; 540 $handler->finishUp(); 539 541 } 540 542 … … 929 931 } 930 932 931 function stopElement( $parser, $name)933 function finishUp( ) 932 934 { 933 935 $nodes = $this->nodes; 934 936 935 if( $name == "GANGLIA_XML" ) 936 { 937 if( sizeof( $this->down_nodes ) > 0 ) 938 { 939 foreach( $this->down_nodes as $reported => $dnodes ) 940 { 941 if( $reported == $this->heartbeat['time'] ) 937 if( sizeof( $this->down_nodes ) > 0 ) 938 { 939 foreach( $this->down_nodes as $reported => $dnodes ) 940 { 941 if( $reported == $this->heartbeat['time'] ) 942 { 943 $domain = $dnodes[1]; 944 945 foreach( $dnodes[0] as $downhost ) 942 946 { 943 $do main = $dnodes[1];944 945 foreach( $dnodes[0] as $downhost)947 $downhost = $this->makeHostname( $downhost, $domain ); 948 949 if( isset( $nodes[$downhost] ) ) 946 950 { 947 $downhost = $this->makeHostname( $downhost, $domain ); 948 949 if( isset( $nodes[$downhost] ) ) 950 { 951 // OMG PHP4 is fking stupid! 952 // $nodes[$downhost]->setDown( 1 ) won't work here.. 953 // 954 $mynode = $nodes[$downhost]; 955 $mynode->setDown( 1 ); 956 $nodes[$downhost] = $mynode; 957 } 951 // OMG PHP4 is fking stupid! 952 // $nodes[$downhost]->setDown( 1 ) won't work here.. 953 // 954 $mynode = $nodes[$downhost]; 955 $mynode->setDown( 1 ); 956 $nodes[$downhost] = $mynode; 958 957 } 959 958 } 960 959 } 961 960 } 962 963 if( sizeof( $this->offline_nodes ) > 0 ) 964 { 965 foreach( $this->offline_nodes as $reported => $onodes ) 966 { 967 if( $reported == $this->heartbeat['time'] ) 961 } 962 963 if( sizeof( $this->offline_nodes ) > 0 ) 964 { 965 foreach( $this->offline_nodes as $reported => $onodes ) 966 { 967 if( $reported == $this->heartbeat['time'] ) 968 { 969 $domain = $onodes[1]; 970 971 foreach( $onodes[0] as $offlinehost ) 968 972 { 969 $ domain = $onodes[1];970 971 foreach( $onodes[0] as $offlinehost)973 $offlinehost = $this->makeHostname( $offlinehost, $domain ); 974 975 if( isset( $nodes[$offlinehost] ) ) 972 976 { 973 $offlinehost = $this->makeHostname( $offlinehost, $domain ); 974 975 if( isset( $nodes[$offlinehost] ) ) 976 { 977 // OMG PHP4 is fking stupid! 978 // $nodes[$offlinehost]->setDown( 1 ) won't work here.. 979 // 980 $mynode = $nodes[$offlinehost]; 981 $mynode->setOffline( 1 ); 982 $nodes[$offlinehost] = $mynode; 983 } 977 // OMG PHP4 is fking stupid! 978 // $nodes[$offlinehost]->setDown( 1 ) won't work here.. 979 // 980 $mynode = $nodes[$offlinehost]; 981 $mynode->setOffline( 1 ); 982 $nodes[$offlinehost] = $mynode; 984 983 } 985 984 } … … 989 988 990 989 $this->nodes = $nodes; 990 } 991 992 function stopElement( $parser, $name ) 993 { 991 994 } 992 995
Note: See TracChangeset
for help on using the changeset viewer.