Blank html file when using cron.d

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
benhorstmann
Posts: 1
Joined: Tue Apr 08, 2014 4:05 pm

Blank html file when using cron.d

Post by benhorstmann »

Quick summary. Weathermap install is stand-alone, not as an integrated cacti plugin. Upgraded last week and fought through a handful of issues, ended up blowing away the www/weathermap folder and pulling down a new one (a simple over-write left some junk behind that was causing issues.) After that, I fought through a PHP split/explode issue and now everything works like a charm... except when scheduling the map generation in cron.

Weathermap 97c.
Ubuntu 10.04.4 LTS
Cacti 0.8.7e


I can run it manually and it generates the png and html files

Code: Select all

sudo ./weathermap --config configs/core-network.conf --output core-network.png --htmloutput core-network.html
If I add it to cron.d or crontab, (tried multiple users including root to wave off permission issues), I end up with a blank .png file.

Syslog shows:

Code: Select all

Apr  8 15:26:01 freshet CRON[26692]: (www-data) CMD (./weathermap --config configs/core-network.conf --output core-network.png --htmloutput core-network.html >/dev/null 2>&1)
Current info in my root crontab:

Code: Select all

#* * * * * /var/www/weathermap/weathermap --config /var/www/weathermap/configs/core-network.conf --output /var/www/weathermap/core-network.png --htmloutput /var/www/weathermap/core-network.html
As far as the syntax in the cron job, i've tried

*adding and removing the full path to the commands
*adding and removing the php and the ./ in front of the weathermap executable
*trying various users (as mentioned above, inc root)

Any direction would be appreciated. Since it runs right off the CLI I'm stumped.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Blank html file when using cron.d

Post by Howie »

Assuming you haven't really got the '#' at the beginning of the line, making this into a comment...

I would see what happens if you change the crontab entry to:

Code: Select all

* * * * * cd /var/www/weathermap/; /var/www/weathermap/weathermap --config /var/www/weathermap/configs/core-network.conf --output /var/www/weathermap/core-network.png --htmloutput /var/www/weathermap/core-network.html
It's possible there is some relative path in there. Your command-line test is from the weathermap directory.

Also assuming you don't still have the 2>&1 >/dev/null part, you should be getting mails with any errors, too, though.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests