ps.monitor: match entire cmdline string

--- ps.monitor 2012-04-11 20:05:21.000000000 -0700
+++ ps.monitor 2017-11-27 17:13:18.252067307 -0800
@@ -51,9 +51,11 @@ while(<@ARGV>) {
 
 # read process table and count the processes of interest
 my $process_table = new Proc::ProcessTable('cache_ttys' => 0 );
-foreach $process ( @{$process_table->table} ) {
-       if( defined($watched_processes{$process->fname}) ) {
-               $watched_processes{$process->fname}[2]++;
+foreach $running_process ( @{$process_table->table} ) {
+        foreach $watched_process ( keys %watched_processes  ) {
+               if( $running_process->cmndline =~ /$watched_process/ && $running_process->pid != $$ ) {
+                       $watched_processes{$watched_process}[2]++;
+               }
        }
 }
 
