crodreamer
25-05-2008, 14:36
"Bushman" said:
Good evening everyone!
Some of you might remember having already seen something similar to the below screenshot.
What is it?
Some of you are certainly checking the status of their different servers on a regular basis with the different available tools.
These tools will give you the current status, mainly checked when a C: line is added to the CCcam.cfg file.
I wanted something providing an overview of my peers over a period of time and therefore created this bash script.
The first version was just creating a text file which was retrieved via ftp* and analyzed by means of an application running on Windows.
The windows application was distributed a while ago and also revised and improved in the meantime
These revisions were nevertheless never published yet as I’m not in a position to provide any support at this stage.
To make it easier for non PC geeks (installing applications, registering dll’s and ocx’s), I decided to improve the script so as to have the output viewable via a webbrowser.
This is the first release and it was tested on a DB500, DB7020 (with Gemini) and also a Linux PC (Ubuntu).
How to install and make it run
1) Edit the file and modify lines 11 to 14 according to requirements
2) Upload the script to your DB (into /var/script for instance)
3) Change permissions to 755
4) Now you need to configure the system to have the script running as a cronjob every 5 minutes
(you can of course decide to have it ran every 10, 20 or 30 minutes if you prefer)
This is easy in Gemini. Blue-Button ->> Extras /Setup ->> Services /Daemons
Select ‘Setup’ for ‘Crond’ and add the script with ‘new’ (every 5 minutes… etc. etc.)
While inside “Services / Daemons”, configure also your HTTP Server (Apache)
Check that your server is running via your browser (http://box_IP:http_port) (for me it only worked after having rebooted my DB)
If everything is ok, you should be in a position to view some output via your web browser typing http://box_IP:http_port/statistics.html
First output will however only be available after 5 minutes…
It is also always possible to “speed up” and make further checks via a telnet session running the script manually.
I will come back later with some additional info, but you should know that:
- Each tick represents 5 minutes (if cronjob has been set accordingly)
- Full screen represents 24 hour (can be modified as well), and is therefore “scrolling” horizontally
- Webfolder contains a file “statistics.txt” keeping full history
- Script folder contains “CCcam_STATISTICS_DO_NOT_TOUCH.txt”: erase if you want to start from scratch, i.e. delete full history.
Note for Bash experts
My scripting knowledge is very basic, so you are welcome to make improvements (optimization)
http://cccamcc.freehoxt.com/CCcam_Statistics.gif
DOWNLOAD HERE (http://cccamcc.freehoxt.com/CCcam_statistics.sh)
Note for LINUX PC users....
Try to run the script via command line and in case you get error messages such as "let not found....", replace the first line of the script with
#!/bin/bash
instead as of:
#!/bin/sh
For the cronjob
Edit /etc/crontab and add something like:
*/5 * * * * user /home/user/card_sharing/Cronjobs/CCcam_statistics.sh >/dev/null 2>&1
search also google for additional information on cronjobs....
Cheers!
Good evening everyone!
Some of you might remember having already seen something similar to the below screenshot.
What is it?
Some of you are certainly checking the status of their different servers on a regular basis with the different available tools.
These tools will give you the current status, mainly checked when a C: line is added to the CCcam.cfg file.
I wanted something providing an overview of my peers over a period of time and therefore created this bash script.
The first version was just creating a text file which was retrieved via ftp* and analyzed by means of an application running on Windows.
The windows application was distributed a while ago and also revised and improved in the meantime
These revisions were nevertheless never published yet as I’m not in a position to provide any support at this stage.
To make it easier for non PC geeks (installing applications, registering dll’s and ocx’s), I decided to improve the script so as to have the output viewable via a webbrowser.
This is the first release and it was tested on a DB500, DB7020 (with Gemini) and also a Linux PC (Ubuntu).
How to install and make it run
1) Edit the file and modify lines 11 to 14 according to requirements
2) Upload the script to your DB (into /var/script for instance)
3) Change permissions to 755
4) Now you need to configure the system to have the script running as a cronjob every 5 minutes
(you can of course decide to have it ran every 10, 20 or 30 minutes if you prefer)
This is easy in Gemini. Blue-Button ->> Extras /Setup ->> Services /Daemons
Select ‘Setup’ for ‘Crond’ and add the script with ‘new’ (every 5 minutes… etc. etc.)
While inside “Services / Daemons”, configure also your HTTP Server (Apache)
Check that your server is running via your browser (http://box_IP:http_port) (for me it only worked after having rebooted my DB)
If everything is ok, you should be in a position to view some output via your web browser typing http://box_IP:http_port/statistics.html
First output will however only be available after 5 minutes…
It is also always possible to “speed up” and make further checks via a telnet session running the script manually.
I will come back later with some additional info, but you should know that:
- Each tick represents 5 minutes (if cronjob has been set accordingly)
- Full screen represents 24 hour (can be modified as well), and is therefore “scrolling” horizontally
- Webfolder contains a file “statistics.txt” keeping full history
- Script folder contains “CCcam_STATISTICS_DO_NOT_TOUCH.txt”: erase if you want to start from scratch, i.e. delete full history.
Note for Bash experts
My scripting knowledge is very basic, so you are welcome to make improvements (optimization)
http://cccamcc.freehoxt.com/CCcam_Statistics.gif
DOWNLOAD HERE (http://cccamcc.freehoxt.com/CCcam_statistics.sh)
Note for LINUX PC users....
Try to run the script via command line and in case you get error messages such as "let not found....", replace the first line of the script with
#!/bin/bash
instead as of:
#!/bin/sh
For the cronjob
Edit /etc/crontab and add something like:
*/5 * * * * user /home/user/card_sharing/Cronjobs/CCcam_statistics.sh >/dev/null 2>&1
search also google for additional information on cronjobs....
Cheers!