Here's a PHP script that I just whipped up.
PHP is probably the easiest language to set up with nginx, because nginx doesn't support plain old CGI, Python/Ruby frameworks are overkill for your purpose, and there are tons of tutorials for setting up Debian+nginx with PHP/FastCGI. (Don't bother with compiling FPM, just use php5-cgi and spawn-fcgi packages from the repository.)
Code:
<?php
if (isset($_GET['process'])) {
$cmd = escapeshellarg($_GET['process']);
$count = shell_exec("ps -C $cmd | wc -l") - 1;
echo "$count processes";
} else {
echo "Error";
}
Save it as "ps.php" someplace where nginx can serve it. Set up nginx to use PHP if you already haven't done so.
Now, visit
http://your-domain-or-ip-address/ps.php?process=process_name. If everything is set up properly, the page will display the number of running processes. (Replace
process_name with the name of the server process that you'd like to monitor. If you're unsure, use the "top" command to see the names of running processes.)
Caution: You probably don't want this script to be accessible to everyone in the world. Although I think I've built in adequate protections from injection attacks, it would be a good idea to hide it where other people won't know.