#!/usr/bin/perl use strict; my $process=$ARGV[0]; my $exactnr=$ARGV[1]; my $vserver=$ARGV[2]; my $nr=`sudo vps aux | awk '{print \$4,\$13}' | grep "$vserver $process" | wc -l`; $nr=sprintf("%d", $nr); if($nr != $exactnr){ print "$process is running $nr times!"; exit(2); } else{ print "$process is running $nr times"; exit(0); }