I needed to capture a custom screen for the last 24 hours and send it out on a daily basis. I saw the script for sending out PDF's of grpahs, but ineed the whole screen full of graphs. To start with I found and installed this plugin to Firefox that allows you to do screen captures form the command line. The plugin is called Page Saver Pro which cost $15 US. Then we wrote a Perl script to go out and capture the page:
Then used a crontab to run it:
This creates the image and then I use a diffrent machine to pull the file and send it out to the people who need it.
BTW you need X running on the system you run the script on and the export command is needed to give firefox some where to display.
Code:
#!/usr/bin/perl -w chomp ($Today=`date +%Y%m%d`); $Template="http://zabbix/screens.php?period=86400&dec=0&inc=0&left=0&right=0&stime=TodaysDateHere0000&action=go&screenid=1&from=0&fullscreen=0"; $NewURL = $Template; $NewURL =~ s/TodaysDateHere/$Today/; system "/usr/bin/firefox -savepng \"$NewURL\" -saveas /zabbix/script/as400.png";
Code:
59 23 * * * export DISPLAY=:0.0 && /zabbix/scripts/as400_proc.pl
BTW you need X running on the system you run the script on and the export command is needed to give firefox some where to display.