- Timestamp:
- 03/08/08 21:51:57 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/job_monarch/libtoga.php
r514 r518 889 889 if( $name == "GANGLIA_XML" ) 890 890 { 891 foreach( $this->down_nodes as $reported => $dnodes ) 892 { 893 894 if( $reported == $this->heartbeat['time'] ) 891 if( sizeof( $this->down_nodes ) > 0 ) 892 { 893 foreach( $this->down_nodes as $reported => $dnodes ) 895 894 { 896 $domain = $dnodes[1]; 897 898 foreach( $dnodes[0] as $downhost ) 895 896 if( $reported == $this->heartbeat['time'] ) 899 897 { 900 $do wnhost = $this->makeHostname( $downhost, $domain );901 902 if( isset( $nodes[$downhost] ))898 $domain = $dnodes[1]; 899 900 foreach( $dnodes[0] as $downhost ) 903 901 { 904 // OMG PHP4 is fking stupid! 905 // $nodes[$downhost]->setDown( 1 ) won't work here.. 906 // 907 $mynode = $nodes[$downhost]; 908 $mynode->setDown( 1 ); 909 $nodes[$downhost] = $mynode; 902 $downhost = $this->makeHostname( $downhost, $domain ); 903 904 if( isset( $nodes[$downhost] ) ) 905 { 906 // OMG PHP4 is fking stupid! 907 // $nodes[$downhost]->setDown( 1 ) won't work here.. 908 // 909 $mynode = $nodes[$downhost]; 910 $mynode->setDown( 1 ); 911 $nodes[$downhost] = $mynode; 912 } 910 913 } 911 914 } … … 913 916 } 914 917 915 foreach( $this->offline_nodes as $reported => $onodes)916 { 917 if( $reported == $this->heartbeat['time'])918 if( sizeof( $this->offline_nodes ) > 0 ) 919 { 920 foreach( $this->offline_nodes as $reported => $onodes ) 918 921 { 919 $domain = $onodes[1]; 920 921 foreach( $onodes[0] as $offlinehost ) 922 if( $reported == $this->heartbeat['time'] ) 922 923 { 923 $ offlinehost = $this->makeHostname( $offlinehost, $domain );924 925 if( isset( $nodes[$offlinehost] ))924 $domain = $onodes[1]; 925 926 foreach( $onodes[0] as $offlinehost ) 926 927 { 927 // OMG PHP4 is fking stupid! 928 // $nodes[$offlinehost]->setDown( 1 ) won't work here.. 929 // 930 $mynode = $nodes[$offlinehost]; 931 $mynode->setOffline( 1 ); 932 $nodes[$offlinehost] = $mynode; 928 $offlinehost = $this->makeHostname( $offlinehost, $domain ); 929 930 if( isset( $nodes[$offlinehost] ) ) 931 { 932 // OMG PHP4 is fking stupid! 933 // $nodes[$offlinehost]->setDown( 1 ) won't work here.. 934 // 935 $mynode = $nodes[$offlinehost]; 936 $mynode->setOffline( 1 ); 937 $nodes[$offlinehost] = $mynode; 938 } 933 939 } 934 940 }
Note: See TracChangeset
for help on using the changeset viewer.