# Get a list of volumes that are being monitored and attempt # to get data about them # $sth = $dbh->prepare("SELECT volumeletter,peernodes from VolData order by volumeid"); $sth->execute(); # Iterate over configured volumes and update status, rrd data and graphs while ( my ($vol,$peernodes) = $sth->fetchrow_array() ) { print "\n\n\nVOLUME $vol Peer nodes ($peernodes)\n\n\n"; # Populate a hash with current volume data %voldata = &getVolumeData($vol,$peernodes); # Now, let's update the database with the volumes current state switch ($voldata{'MirrorState'}) { case "0" {$vol_current_state = "Not Mirrored"} case "1" {$vol_current_state = "Mirroring"} case "2" {$vol_current_state = "Resync"} case "3" {$vol_current_state = "Broken"} case "4" {$vol_current_state = "Paused"} case "5" {$vol_current_state = "Resync Pending"} else {$vol_current_state = "Unknown"} } print "COLLECTOR: Setting volume $vol to state $vol_current_state\n"; #$sth = $dbh->prepare("UPDATE VolData SET volstatus = '$vol_current_state' WHERE volumeletter = '$vol'"); #$sth->execute(); }