Changeset 585
- Timestamp:
- 02/06/08 18:07:59 (1 year ago)
- Files:
-
- branches/1.3/A2Billing_AGI/libs_a2billing/crontjob/a2billing_alarm.php (modified) (6 diffs)
- experimental_v2/Cronjobs/a2billing_alarm.php (modified) (6 diffs)
- trunk/Cronjobs/a2billing_alarm.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.3/A2Billing_AGI/libs_a2billing/crontjob/a2billing_alarm.php
r515 r585 122 122 write_log(LOGFILE_CRONT_ALARM, basename(__FILE__).' line:'.__LINE__."[Alarm : ".$myalarm[1]." ]"); 123 123 124 $QUERY = "SELECT COUNT(*) FROM cc_call $SQL_CLAUSE"; 124 $QUERY = "SELECT COUNT(*) FROM cc_call $SQL_CLAUSE"; 125 125 if ($verbose_level>=1) echo "\n===> QUERY = $QUERY\n"; 126 $calls = $instance_table -> SQLExec ($A2B -> DBHandle, $QUERY,1); 126 $calls = $instance_table -> SQLExec ($A2B -> DBHandle, $QUERY,1); 127 127 $nb_card = $calls[0][0]; 128 128 $nbpagemax=(intval($nb_card/$groupcalls)); … … 141 141 $max=0; 142 142 $update=array(); 143 for ($page = 0; $page <= $nbpagemax; $page++) 143 for ($page = 0; $page <= $nbpagemax; $page++) 144 144 { 145 145 // REST AFTER $groupcalls CARD HANDLED … … 166 166 $totalfail+=$res[$i][1]; 167 167 $totaltime+=$res[$i][2]; 168 // FIND THE CIC (Consecutive Incomplete Calls) 168 // FIND THE CIC (Consecutive Incomplete Calls) 169 169 if($res[$i][1] == 1) $max++; 170 170 if($res[$i][1] == 0) … … 175 175 } 176 176 } 177 if($max > $max_fail) $max_fail = $max; 178 179 } // LOOP FOR THE CALLS 177 if($max > $max_fail) $max_fail = $max; 178 179 } // LOOP FOR THE CALLS 180 180 181 181 … … 185 185 $ALOC = $totaltime / ($totalsuccess + $totalfail); 186 186 187 $send_alarm = false; 187 $send_alarm = false; 188 188 189 189 //$type_list ["0" ALOC, "1" ASR, "2" CIC] 190 190 switch ($myalarm[3]) { 191 191 case 1: 192 if ( $ALOC > = $myalarm[4] || $ALOC <=$myalarm[5]){192 if ( $ALOC > $myalarm[4] || $ALOC < $myalarm[5]){ 193 193 $value=$ALOC; 194 194 $send_alarm=true; 195 195 } 196 $content="\n\n The ALOC $ALOC second e is too low or too hight than the max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm";197 break; 196 $content="\n\n The ALOC $ALOC seconds is outside the range max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm"; 197 break; 198 198 case 2: 199 if ($ASR > = $myalarm[4] || $ASR <=$myalarm[5]){199 if ($ASR > $myalarm[4] || $ASR < $myalarm[5]){ 200 200 $value = $ASR; 201 201 $send_alarm=true; 202 202 } 203 $content="\n\n The ASR $ASR is too low or too hight than the max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm";203 $content="\n\n The ASR ".$ASR."% is outside the range max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm"; 204 204 break; 205 205 206 206 case 3: 207 if ($max_fail >= $myalarm[4]){ 207 if ($max_fail >= $myalarm[4]){ 208 208 $value=$max_fail; 209 209 $send_alarm=true; 210 210 } 211 $content="\n\n The Max Consecutive Incomplete Calls : ".$max_fail." calls is too hightthan the max: ".$myalarm[4]." defined in the alarm";211 $content="\n\n The Max Consecutive Incomplete Calls : ".$max_fail." calls is greater than the max: ".$myalarm[4]." defined in the alarm"; 212 212 break; 213 213 } … … 221 221 write_log(LOGFILE_CRONT_ALARM, basename(__FILE__).' line:'.__LINE__."[Alarm report : 'Alarm name=$myalarm[1]', 'Alarm type=$myalarm[3]', 'Calculated value=$value']"); 222 222 223 // UPDATE THE ALARM 223 // UPDATE THE ALARM 224 224 if ($send_alarm) $add_field=", numberofalarm=numberofalarm+1"; 225 225 else $add_field=""; experimental_v2/Cronjobs/a2billing_alarm.php
r546 r585 122 122 write_log(LOGFILE_CRONT_ALARM, basename(__FILE__).' line:'.__LINE__."[Alarm : ".$myalarm[1]." ]"); 123 123 124 $QUERY = "SELECT COUNT(*) FROM cc_call $SQL_CLAUSE"; 124 $QUERY = "SELECT COUNT(*) FROM cc_call $SQL_CLAUSE"; 125 125 if ($verbose_level>=1) echo "\n===> QUERY = $QUERY\n"; 126 $calls = $instance_table -> SQLExec ($A2B -> DBHandle, $QUERY,1); 126 $calls = $instance_table -> SQLExec ($A2B -> DBHandle, $QUERY,1); 127 127 $nb_card = $calls[0][0]; 128 128 $nbpagemax=(intval($nb_card/$groupcalls)); … … 141 141 $max=0; 142 142 $update=array(); 143 for ($page = 0; $page <= $nbpagemax; $page++) 143 for ($page = 0; $page <= $nbpagemax; $page++) 144 144 { 145 145 // REST AFTER $groupcalls CARD HANDLED … … 166 166 $totalfail+=$res[$i][1]; 167 167 $totaltime+=$res[$i][2]; 168 // FIND THE CIC (Consecutive Incomplete Calls) 168 // FIND THE CIC (Consecutive Incomplete Calls) 169 169 if($res[$i][1] == 1) $max++; 170 170 if($res[$i][1] == 0) … … 175 175 } 176 176 } 177 if($max > $max_fail) $max_fail = $max; 178 179 } // LOOP FOR THE CALLS 177 if($max > $max_fail) $max_fail = $max; 178 179 } // LOOP FOR THE CALLS 180 180 181 181 … … 185 185 $ALOC = $totaltime / ($totalsuccess + $totalfail); 186 186 187 $send_alarm = false; 187 $send_alarm = false; 188 188 189 189 //$type_list ["0" ALOC, "1" ASR, "2" CIC] 190 190 switch ($myalarm[3]) { 191 191 case 1: 192 if ( $ALOC > = $myalarm[4] || $ALOC <=$myalarm[5]){192 if ( $ALOC > $myalarm[4] || $ALOC < $myalarm[5]){ 193 193 $value=$ALOC; 194 194 $send_alarm=true; 195 195 } 196 $content="\n\n The ALOC $ALOC second e is too low or too hight than the max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm";197 break; 196 $content="\n\n The ALOC $ALOC seconds is outside the range max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm"; 197 break; 198 198 case 2: 199 if ($ASR > = $myalarm[4] || $ASR <=$myalarm[5]){199 if ($ASR > $myalarm[4] || $ASR < $myalarm[5]){ 200 200 $value = $ASR; 201 201 $send_alarm=true; 202 202 } 203 $content="\n\n The ASR $ASR is too low or too hight than the max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm";203 $content="\n\n The ASR ".$ASR."% is outside the range max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm"; 204 204 break; 205 205 206 206 case 3: 207 if ($max_fail >= $myalarm[4]){ 207 if ($max_fail >= $myalarm[4]){ 208 208 $value=$max_fail; 209 209 $send_alarm=true; 210 210 } 211 $content="\n\n The Max Consecutive Incomplete Calls : ".$max_fail." calls is too hightthan the max: ".$myalarm[4]." defined in the alarm";211 $content="\n\n The Max Consecutive Incomplete Calls : ".$max_fail." calls is greater than the max: ".$myalarm[4]." defined in the alarm"; 212 212 break; 213 213 } … … 221 221 write_log(LOGFILE_CRONT_ALARM, basename(__FILE__).' line:'.__LINE__."[Alarm report : 'Alarm name=$myalarm[1]', 'Alarm type=$myalarm[3]', 'Calculated value=$value']"); 222 222 223 // UPDATE THE ALARM 223 // UPDATE THE ALARM 224 224 if ($send_alarm) $add_field=", numberofalarm=numberofalarm+1"; 225 225 else $add_field=""; trunk/Cronjobs/a2billing_alarm.php
r546 r585 122 122 write_log(LOGFILE_CRONT_ALARM, basename(__FILE__).' line:'.__LINE__."[Alarm : ".$myalarm[1]." ]"); 123 123 124 $QUERY = "SELECT COUNT(*) FROM cc_call $SQL_CLAUSE"; 124 $QUERY = "SELECT COUNT(*) FROM cc_call $SQL_CLAUSE"; 125 125 if ($verbose_level>=1) echo "\n===> QUERY = $QUERY\n"; 126 $calls = $instance_table -> SQLExec ($A2B -> DBHandle, $QUERY,1); 126 $calls = $instance_table -> SQLExec ($A2B -> DBHandle, $QUERY,1); 127 127 $nb_card = $calls[0][0]; 128 128 $nbpagemax=(intval($nb_card/$groupcalls)); … … 141 141 $max=0; 142 142 $update=array(); 143 for ($page = 0; $page <= $nbpagemax; $page++) 143 for ($page = 0; $page <= $nbpagemax; $page++) 144 144 { 145 145 // REST AFTER $groupcalls CARD HANDLED … … 166 166 $totalfail+=$res[$i][1]; 167 167 $totaltime+=$res[$i][2]; 168 // FIND THE CIC (Consecutive Incomplete Calls) 168 // FIND THE CIC (Consecutive Incomplete Calls) 169 169 if($res[$i][1] == 1) $max++; 170 170 if($res[$i][1] == 0) … … 175 175 } 176 176 } 177 if($max > $max_fail) $max_fail = $max; 178 179 } // LOOP FOR THE CALLS 177 if($max > $max_fail) $max_fail = $max; 178 179 } // LOOP FOR THE CALLS 180 180 181 181 … … 185 185 $ALOC = $totaltime / ($totalsuccess + $totalfail); 186 186 187 $send_alarm = false; 187 $send_alarm = false; 188 188 189 189 //$type_list ["0" ALOC, "1" ASR, "2" CIC] 190 190 switch ($myalarm[3]) { 191 191 case 1: 192 if ( $ALOC > = $myalarm[4] || $ALOC <=$myalarm[5]){192 if ( $ALOC > $myalarm[4] || $ALOC < $myalarm[5]){ 193 193 $value=$ALOC; 194 194 $send_alarm=true; 195 195 } 196 $content="\n\n The ALOC $ALOC second e is too low or too hight than the max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm";197 break; 196 $content="\n\n The ALOC $ALOC seconds is outside the range max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm"; 197 break; 198 198 case 2: 199 if ($ASR > = $myalarm[4] || $ASR <=$myalarm[5]){199 if ($ASR > $myalarm[4] || $ASR < $myalarm[5]){ 200 200 $value = $ASR; 201 201 $send_alarm=true; 202 202 } 203 $content="\n\n The ASR $ASR is too low or too hight than the max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm";203 $content="\n\n The ASR ".$ASR."% is outside the range max: ".$myalarm[4]." min:".$myalarm[5]." defined in the alarm"; 204 204 break; 205 205 206 206 case 3: 207 if ($max_fail >= $myalarm[4]){ 207 if ($max_fail >= $myalarm[4]){ 208 208 $value=$max_fail; 209 209 $send_alarm=true; 210 210 } 211 $content="\n\n The Max Consecutive Incomplete Calls : ".$max_fail." calls is too hightthan the max: ".$myalarm[4]." defined in the alarm";211 $content="\n\n The Max Consecutive Incomplete Calls : ".$max_fail." calls is greater than the max: ".$myalarm[4]." defined in the alarm"; 212 212 break; 213 213 } … … 221 221 write_log(LOGFILE_CRONT_ALARM, basename(__FILE__).' line:'.__LINE__."[Alarm report : 'Alarm name=$myalarm[1]', 'Alarm type=$myalarm[3]', 'Calculated value=$value']"); 222 222 223 // UPDATE THE ALARM 223 // UPDATE THE ALARM 224 224 if ($send_alarm) $add_field=", numberofalarm=numberofalarm+1"; 225 225 else $add_field="";
