No uptime stats when running mod_ruid2 + cPanel jail..

I’m using the below page to monitor and collect some of the most important servers I got, see:
https://k0nsl.org/ServerStatus/

But ran into an issue with permissions when running under mod_ruid2 + cPanel jail, it won’t collect some of the vital statistics, merely the disk space, so that’s no good.
I could only think of one easy solution to it. A cronjob!
First, I renamed uptime.php (the original with PHP code) to uptime_fix.php, then added crontab with:

crontab -e

And added this line:

0 * * * * php /the/path/to/uptime_fix.php > /the/path/to/uptime.php

That will circumvent the permissions issue, but remember to add the cronjob under a user which has adequate permissions. Another thing, be sure to read this comment. After that, all is good. There’s a better way? Do tell.

By the way, the contents of “uptime.php” will just look something like this:

[gist]https://gist.github.com/k0nsl/8232796[/gist]

3 Comments

Add a Comment

Your email address will not be published. Required fields are marked *