print "checking disk space...\n\n";

@machines= ('100','101','102','103','104');

foreach $machine (@machines) {
    @stuff = `ssh ippc18 'ssh ipp$machine df | grep ipp$machine.'`;
    foreach $item (@stuff) {
	chomp $item;
	@split =  split(/\s+/, $item);
	print "$item\n";
#	print $split[3];#
#	print $split[5];
	if ($split[3] < 1000000000) {
	    print "LOW DISK SPACE FOR $split[5]\n";
	}
    }
    
}

$com = "ssh ippc19 'mysql -h ipp106 -u dvo -pdvo ipptopsps2 -e \"select count(*) from batch where dvo_db = 'LAP.PV3.MERGE'\"'";

print $com;

#foreach $thing (@stuff) {
#    print $thing;

#}


#select  datastore_product , count(*), date(timestamp) as date, hour(timestamp) as hour  from batch where loaded_to_datastore = 1 and dvo_db = "LAP.PV3.MERGE" and (batch_type = "ST") and date(timestamp) > '2016-10-13' group by batch_type, date, hour; select count(*), name from pending join box on box_id = id join skychunk on name = skychunk group by batch_type;select datastore_product , count(*), date(timestamp) as date  from batch where loaded_to_datastore = 1 and dvo_db = "LAP.PV3.MERGE" and (batch_type = "ST") group by batch_type, date;
