Changeset 42858 for trunk/ippMonitor/czartool/czarpoll.pl
- Timestamp:
- May 13, 2025, 1:13:09 PM (14 months ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/czartool/czarpoll.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/czartool/czarpoll.pl
r42798 r42858 229 229 230 230 my $server = undef; 231 my $alive = undef; 232 my $running = undef; 231 232 my ($alive, $running); 233 233 234 foreach $server (@{$servers}) { 235 # For gpc1 234 236 $pantasks->getServerStatus($server,'gpc1', \$alive, \$running); 235 237 $czarDb->updateServerStatus($server,'gpc1', $alive, $running); 238 # For gpc2 236 239 $pantasks->getServerStatus($server,'gpc2', \$alive, \$running); 237 240 $czarDb->updateServerStatus($server,'gpc2', $alive, $running); 241 238 242 } 239 243 } … … 245 249 ########################################################################### 246 250 sub updateServerStatusLive { 247 print "* Checking all pantasks servers\n";251 print "* Checking all pantasks live servers\n"; 248 252 249 253 my $servers = $pantasks->getServerList(); 250 254 251 255 my $server = undef; 252 my $alive = undef;253 my $running = undef; 256 my ($alive, $running, $pan_host); 257 254 258 foreach $server (@{$servers}) { 255 $pantasks->getServerStatus($server,'gpc1', \$alive, \$running); 256 $czarDb->updateServerStatusLive($server,'gpc1', $alive, $running); 257 $pantasks->getServerStatus($server,'gpc2', \$alive, \$running); 258 $czarDb->updateServerStatusLive($server,'gpc2', $alive, $running); 259 # For gpc1 260 $pantasks->getServerStatus($server,'gpc1', \$alive, \$running, \$pan_host); 261 $czarDb->updateServerStatusLive($server,'gpc1', $alive, $running, $pan_host); 262 print "Server: $server | Telescope: gpc1 | Alive: $alive | Running: $running | Host: " . (defined $pan_host ? $pan_host : "undef") . "\n"; 263 # For gpc2 264 $pantasks->getServerStatus($server,'gpc2', \$alive, \$running, \$pan_host); 265 $czarDb->updateServerStatusLive($server,'gpc2', $alive, $running, $pan_host); 266 print "Server: $server | Telescope: gpc2 | Alive: $alive | Running: $running | Host: " . (defined $pan_host ? $pan_host : "undef") . "\n"; 259 267 } 260 268 } … … 637 645 638 646 # Convert KB to TB 639 my $total_tb = sprintf("%. 1f", $blocks / 1024 / 1024 / 1024);640 my $used_tb = sprintf("%. 1f", $used / 1024 / 1024 / 1024);641 my $available_tb = sprintf("%. 1f", $available / 1024 / 1024 / 1024);647 my $total_tb = sprintf("%.3f", $blocks / 1024 / 1024 / 1024 ); 648 my $used_tb = sprintf("%.3f", $used / 1024 / 1024 / 1024 ); 649 my $available_tb = sprintf("%.3f", $available / 1024 / 1024 / 1024 ); 642 650 643 651 my $used_percent = sprintf("%.3f", $used / $blocks * 100); … … 650 658 651 659 # Example: ippdb01.0(3.5T) 652 my $host_label = "$host.$suffix(${total_tb}T)"; 653 $czarDb->updateHost($host_label, 100, $available_percent, $used_percent, $readable, $writable); 654 } 655 } 656 } 660 #my $host_label = "$host.$suffix(${total_tb}T)"; 661 my $host_label = "$host.$suffix"; 662 $czarDb->updateHost($host_label, $total_tb, $available_tb, $used_tb, $readable, $writable); 663 } 664 } 665 }
Note:
See TracChangeset
for help on using the changeset viewer.
