Changeset 42922 for trunk/ippMonitor/raw/czartool_labels.php
- Timestamp:
- Sep 10, 2025, 3:57:45 PM (10 months ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/raw/czartool_labels.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/raw/czartool_labels.php
r42921 r42922 1846 1846 exec("neb-host |cut -b 17-30,86-", $hostnoteall); 1847 1847 1848 $sql = "SELECT host, format(total, 2), format(available, 2), format(used, 2), writable, readable, format(used/total*100,3) as ratio FROM hosts where xattr <> 3 ";1848 $sql = "SELECT host, format(total, 2), format(available, 2), format(used, 2), writable, readable, format(used/total*100,3) as ratio FROM hosts where xattr <> 3 ORDER BY CASE WHEN ROUND(used/total*100,3) = 100 THEN 0 ELSE 1 END, CASE WHEN host LIKE '%\_bck.0' THEN 1 ELSE 0 END, host;"; 1849 1849 $qry = $db->query($sql); 1850 1850 … … 1854 1854 } 1855 1855 1856 $sqlMax = "SELECT MAX(total) AS max_total FROM hosts WHERE xattr <> 3"; 1857 $qryMax = $db->query($sqlMax); 1858 $maxUsed = 0; 1859 1860 if ($qryMax && $qryMax->fetchInto($rowMax)) { 1861 $maxUsed = $rowMax[0]; // max_total value 1862 } 1863 1856 1864 $dataRows = array(); 1857 $maxUsed = 0; // initialize before the while loop1858 1859 1865 while ($qry->fetchInto($row)) { 1860 1866 // Access by index … … 1866 1872 $readable = $row[5]; // 1 1867 1873 $ratio = $row[6]; // 86.4939 % 1868 1869 // update maxUsed1870 if ($total > $maxUsed) {1871 $maxUsed = $total/2;1872 }1873 1874 1874 1875 // Match notes … … 1893 1894 } elseif ($available < 1) { 1894 1895 $used = $maxUsed; 1895 $available = $maxUsed;1896 $available = 0; 1896 1897 $status = "offline"; 1897 1898 $usedColor = "white";
Note:
See TracChangeset
for help on using the changeset viewer.
