Added server_live_partitions inserts/updates to update_AMI2 script
Added partition display to admin.php git-svn-id: svn://192.168.202.10@3956 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
# 210827-0930 - Added PJSIP compatibility
|
||||
# 220310-1136 - Fix for issue dealing with bad carrier 'P-Asserted-Identity' input
|
||||
# 251008-2114 - Added code for recording_dtmf_detection and recording_dtmf_muting
|
||||
# 251203-2218 - Added server_live_partitions inserts/updates
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -1758,6 +1759,7 @@ sub get_disk_space
|
||||
@serverDISK = `$dfbin -B 1048576 -x nfs -x cifs -x sshfs -x ftpfs`;
|
||||
$ct=0;
|
||||
$ct_PCT=0;
|
||||
$part_order=0;
|
||||
$disk_usage = '';
|
||||
foreach(@serverDISK)
|
||||
{
|
||||
@@ -1767,6 +1769,23 @@ sub get_disk_space
|
||||
$usage = $1;
|
||||
$usage =~ s/\%//gi;
|
||||
$disk_usage .= "$ct_PCT $usage|";
|
||||
$partition_path = $serverDISK[$ct];
|
||||
$partition_path =~ s/.*\% |\r|\n|\t//gi;
|
||||
$partition_filesystem = $serverDISK[$ct];
|
||||
$partition_filesystem =~ s/ .*|\r|\n|\t//gi;
|
||||
$disk_data = $serverDISK[$ct];
|
||||
$disk_data =~ s/\s+/ /gi;
|
||||
@disk_dataARY = split(/ /,$disk_data);
|
||||
$mb_used = $disk_dataARY[2];
|
||||
$mb_available = $disk_dataARY[3];
|
||||
|
||||
# insert/update server_live_drives record in the DB
|
||||
$stmtA = "INSERT INTO server_live_partitions set server_ip='$server_ip',partition_path='$partition_path',update_time=NOW(),partition_order='$part_order',partition_filesystem='$partition_filesystem',use_pct='$usage',mb_used='$mb_used',mb_available='$mb_available' ON DUPLICATE KEY UPDATE update_time=NOW(),partition_order='$part_order',partition_filesystem='$partition_filesystem',use_pct='$usage',mb_used='$mb_used',mb_available='$mb_available';";
|
||||
if($DB){print STDERR "\n$stmtA\n";}
|
||||
$dbhA->do($stmtA);
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
|
||||
$part_order++;
|
||||
}
|
||||
$ct++;
|
||||
}
|
||||
|
||||
@@ -6299,12 +6299,13 @@ if ($SSscript_remove_js > 0)
|
||||
# 251019-2024 - Added Recording DTMF Muting
|
||||
# 251025-1924 - Added CRASHED DATABASE TABLES display page, db_crashed_tables_check system settings option
|
||||
# 251112-2201 - Added alter_cid_name DID option
|
||||
# 251204-0757 - Added SERVER DRIVE PARTITIONS display
|
||||
#
|
||||
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
|
||||
|
||||
$admin_version = '2.14-948a';
|
||||
$build = '251112-2201';
|
||||
$admin_version = '2.14-949a';
|
||||
$build = '251204-0757';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -7381,6 +7382,7 @@ if ($ADD==999987) {$hh='reports'; echo _QXZ("PHONE CODES");}
|
||||
if ($ADD==999986) {$hh='reports'; echo _QXZ("POSTAL CODES");}
|
||||
if ($ADD==999985) {$hh='reports'; echo _QXZ("POSTAL CODES CITIES");}
|
||||
if ($ADD==999984) {$hh='reports'; echo _QXZ("CRASHED DATABASE TABLES");}
|
||||
if ($ADD==999983) {$hh='reports'; echo _QXZ("SERVER DRIVE PARTITIONS");}
|
||||
|
||||
echo "</title>\n";
|
||||
|
||||
@@ -41826,6 +41828,23 @@ if ($ADD==311111111111)
|
||||
$live_agents = $row[0];
|
||||
if ($DB > 0) {echo "|$live_agents|$stmt|\n";}
|
||||
|
||||
# look for server_live_partitions entries for this server
|
||||
$stmt="SELECT partition_order,use_pct from server_live_partitions where server_ip='$server_ip' and (mb_used + mb_available) >= 1000;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$parts_to_print = mysqli_num_rows($rslt);
|
||||
$pp=0;
|
||||
$temp_disk_usage='';
|
||||
while ($parts_to_print > $pp)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$part_order = ($row[0] + 1);
|
||||
$temp_disk_usage .= "$part_order $row[1]|";
|
||||
$pp++;
|
||||
}
|
||||
if (strlen($temp_disk_usage) > 3)
|
||||
{$disk_usage = $temp_disk_usage;}
|
||||
|
||||
$cpu = (100 - $cpu_idle_percent);
|
||||
$disk_usage = preg_replace("/ /"," - ",$disk_usage);
|
||||
$disk_usage = preg_replace("/\|/","% ",$disk_usage);
|
||||
@@ -41843,7 +41862,15 @@ if ($ADD==311111111111)
|
||||
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("System Load").": </td><td align=left>$sysload - $cpu% $NWB#servers-sysload$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Live Channels").": </td><td align=left>$channels_total "._QXZ("Agents").": $live_agents $NWB#servers-channels_total$NWE</td></tr>\n";
|
||||
|
||||
if ($pp > 0)
|
||||
{
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right><a href=\"$PHP_SELF?ADD=999983&server_ip=$server_ip&server_id=$server_id\">"._QXZ("Disk Usage")."</a>: </td><td align=left><font size=0>$disk_usage</font> $NWB#servers-disk_usage$NWE</td></tr>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Disk Usage").": </td><td align=left><font size=0>$disk_usage</font> $NWB#servers-disk_usage$NWE</td></tr>\n";
|
||||
}
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("System Uptime").": </td><td align=left>$system_uptime $NWB#servers-system_uptime$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Admin User Group").": </td><td align=left><select size=1 name=user_group>\n";
|
||||
@@ -50166,6 +50193,22 @@ if ($ADD==999999)
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$inventory_report_count = $row[0];
|
||||
|
||||
# look for server_live_partitions entries for this server
|
||||
$stmt="SELECT partition_order,use_pct from server_live_partitions where server_ip='$server_ip[$i]' and (mb_used + mb_available) >= 1000;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$parts_to_print = mysqli_num_rows($rslt);
|
||||
$pp=0;
|
||||
$temp_disk_usage='';
|
||||
while ($parts_to_print > $pp)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$part_order = ($row[0] + 1);
|
||||
$temp_disk_usage .= "$part_order $row[1]|";
|
||||
$pp++;
|
||||
}
|
||||
if (strlen($temp_disk_usage) > 3)
|
||||
{$disk_usage[$i] = $temp_disk_usage;}
|
||||
?>
|
||||
|
||||
</head><BODY BGCOLOR=WHITE>
|
||||
@@ -52308,6 +52351,23 @@ if ($ADD==999991)
|
||||
$o=0;
|
||||
while ($servers_to_print > $o)
|
||||
{
|
||||
# look for server_live_partitions entries for this server
|
||||
$stmt="SELECT partition_order,use_pct from server_live_partitions where server_ip='$server_ip[$o]' and (mb_used + mb_available) >= 1000;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$parts_to_print = mysqli_num_rows($rslt);
|
||||
$pp=0;
|
||||
$temp_disk_usage='';
|
||||
while ($parts_to_print > $pp)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$part_order = ($row[0] + 1);
|
||||
$temp_disk_usage .= "$part_order $row[1]|";
|
||||
$pp++;
|
||||
}
|
||||
if (strlen($temp_disk_usage) > 3)
|
||||
{$disk_usage[$o] = $temp_disk_usage;}
|
||||
|
||||
$cpu = (100 - $cpu_idle_percent[$o]);
|
||||
$disk = '';
|
||||
$disk_ary = explode('|',$disk_usage[$o]);
|
||||
@@ -52331,7 +52391,14 @@ if ($ADD==999991)
|
||||
echo "<TD>$active[$o]</TD>\n";
|
||||
echo "<TD>$sysload[$o] - $cpu%</TD>\n";
|
||||
echo "<TD>$channels_total[$o]</TD>\n";
|
||||
if ($pp > 0)
|
||||
{
|
||||
echo "<TD ALIGN=RIGHT><a href=\"$PHP_SELF?ADD=999983&server_ip=$server_ip[$o]&server_id=$server_id[$o]\">$disk</a></TD>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<TD ALIGN=RIGHT>$disk</TD>\n";
|
||||
}
|
||||
|
||||
$s_time=' ';
|
||||
$s_ver=' ';
|
||||
@@ -52827,7 +52894,7 @@ if ($ADD==999984)
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$crashes_to_print = mysqli_num_rows($rslt);
|
||||
$o=0; $o_ct=1;
|
||||
$row_color=0; $last_country='';
|
||||
$row_color=0;
|
||||
while ($crashes_to_print > $o)
|
||||
{
|
||||
$rowx=mysqli_fetch_row($rslt);
|
||||
@@ -52870,6 +52937,77 @@ if ($ADD==999984)
|
||||
##### END CRASHED DATABASE TABLES display page #####
|
||||
|
||||
|
||||
######################
|
||||
# ADD=999983 - SERVER DRIVE PARTITIONS display page
|
||||
######################
|
||||
if ($ADD==999983)
|
||||
{
|
||||
$partition_rows='';
|
||||
# look for server_live_partitions entries for this server
|
||||
$stmt="SELECT update_time,server_ip,partition_order,partition_path,partition_filesystem,use_pct,mb_used,mb_available FROM server_live_partitions where server_ip='$server_ip' order by update_time desc, partition_order;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$parts_to_print = mysqli_num_rows($rslt);
|
||||
$o=0; $o_ct=1;
|
||||
$row_color=0;
|
||||
$temp_disk_usage='';
|
||||
while ($parts_to_print > $o)
|
||||
{
|
||||
$rowx=mysqli_fetch_row($rslt);
|
||||
$tot_mb = ($rowx[6] + $rowx[7]);
|
||||
if ($tot_mb >= 1000)
|
||||
{
|
||||
$bgcolor='bgcolor="#'. $SSstd_row2_background .'"';
|
||||
$fontcolor='color="#000000"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$bgcolor='bgcolor="#E6E6E6"';
|
||||
$fontcolor='color="#666666"';
|
||||
}
|
||||
$partition_rows .= "<tr $bgcolor>\n";
|
||||
$partition_rows .= "<td align=center><font size=1 $fontcolor>$o_ct</font></td>\n";
|
||||
$partition_rows .= "<td align=left><font size=2 $fontcolor>$rowx[3]</font></td>\n";
|
||||
$partition_rows .= "<td align=left><font size=2 $fontcolor>$rowx[4]</font></td>\n";
|
||||
$partition_rows .= "<td align=right><font size=2 $fontcolor>$rowx[5]%</font></td>\n";
|
||||
$partition_rows .= "<td align=right><font size=2 $fontcolor>$tot_mb</font></td>\n";
|
||||
$partition_rows .= "<td align=right><font size=2 $fontcolor>$rowx[6]</font></td>\n";
|
||||
$partition_rows .= "<td align=right><font size=2 $fontcolor>$rowx[7]</font></td>\n";
|
||||
$partition_rows .= "<td align=center><font size=1 $fontcolor>$rowx[0]</font></td>\n";
|
||||
$partition_rows .= "</tr>\n";
|
||||
$o++; $o_ct++;
|
||||
}
|
||||
|
||||
if ($o > 0)
|
||||
{
|
||||
echo "<CENTER><BR><FONT FACE=\"ARIAL,HELVETICA\" SIZE=3><B>"._QXZ("This server's %1s partitions are",0,'',$o).":</B></FONT><BR></CENTER>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<CENTER><BR><BR><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2>"._QXZ("This server has no partition details currently")."</FONT><BR><BR></CENTER>\n";
|
||||
}
|
||||
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
echo "<br>"._QXZ("SERVER DRIVE PARTITIONS FOR SERVER").": <a href=\"$PHP_SELF?ADD=311111111111&server_id=$server_id\">$server_id - $server_ip</a>\n";
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#$SSstd_row3_background>\n";
|
||||
echo "<td align=center><B> # </B></td>\n";
|
||||
echo "<td align=center><B>"._QXZ("Path")."</B></td>\n";
|
||||
echo "<td align=center><B>"._QXZ("Filesystem")."</B></td>\n";
|
||||
echo "<td align=center><B>"._QXZ("Use %")."</B></td>\n";
|
||||
echo "<td align=center><B>"._QXZ("Total Size(MB)")."</B></td>\n";
|
||||
echo "<td align=center><B>"._QXZ("Used (MB)")."</B></td>\n";
|
||||
echo "<td align=center><B>"._QXZ("Available (MB)")."</B></td>\n";
|
||||
echo "<td align=center><B><font size=1>"._QXZ("Update Time")."</font></B></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "$partition_rows";
|
||||
echo "</TABLE></center></form>\n";
|
||||
}
|
||||
##### END SERVER DRIVE PARTITIONS display page #####
|
||||
|
||||
|
||||
echo "</TD></TR></TABLE></center>\n";
|
||||
echo "</TD></TR></TABLE></center>\n";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# version: 20251112180001
|
||||
# version: 20251203232501
|
||||
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-.</QXZ>
|
||||
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length, unless the User Password Minimum Length system setting is enabled, which will require a longer password. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
|
||||
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ>
|
||||
@@ -1051,7 +1051,7 @@ servers-active Active <QXZ>Set whether the Asterisk server is active or inactive
|
||||
servers-user_group Admin User Group <QXZ>This is the administrative user group for this record, this allows admin viewing of this record restricted by user group. Default is --ALL-- which allows any admin user to view this record.</QXZ>
|
||||
servers-sysload System Load <QXZ>These two statistics show the loadavg of a system times 100 and the CPU usage percentage of the server and is updated every minute. The loadavg should on average be below 100 multiplied by the number of CPU cores your system has, for optimal performance. The CPU usage percentage should stay below 50 for optimal performance.</QXZ>
|
||||
servers-channels_total Live Channels <QXZ>This field shows the current number of Asterisk channels that are live on the system right now. It is important to note that the number of Asterisk channels is usually much higher than the number of actual calls on a system. This field is updated once every minute.</QXZ> <QXZ>The Agents field shows the current number of agents logged into the agent screen on this server.</QXZ>
|
||||
servers-disk_usage Disk Usage <QXZ>This field will show the disk usage for every partition on this server. This field is updated once every minute.</QXZ>
|
||||
servers-disk_usage Disk Usage <QXZ>This field will show the disk usage for every partition greater than 1GB in size on this server. This field is updated once every minute.</QXZ>
|
||||
servers-system_uptime System Uptime <QXZ>This field will show the system uptime of this server. This field only updates if configured to do so by your administrator.</QXZ>
|
||||
servers-asterisk_version Asterisk Version <QXZ>Set the version of Asterisk that you have installed on this server. Examples: 1.2, 1.0.8, 1.0.7, CVS_HEAD, REALLY OLD, etc... This is used because versions 1.0.8 and 1.0.9 have a different method of dealing with Local/ channels, a bug that has been fixed in CVS v1.0, and need to be treated differently when handling their Local/ channels. Also, current CVS_HEAD and the 1.2 release tree uses different manager and command output so it must be treated differently as well.</QXZ>
|
||||
servers-max_trunks Max Trunks <QXZ>This field will determine the maximum number of lines that the auto-dialer will attempt to call on this server. If you want to dedicate two full PRI T1s to outbound dialing on a server then you would set this to 46. Any inbound or manual dial calls will be counted against this total as well. Default is 96.</QXZ>
|
||||
|
||||
Reference in New Issue
Block a user