ispCP - Board - Support
Graphical Statistics whith RRD-tools - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Contributions Area (/forum-40.html)
+--- Forum: Howtos (/forum-41.html)
+--- Thread: Graphical Statistics whith RRD-tools (/thread-10184.html)

Pages: 1 2


Graphical Statistics whith RRD-tools - data-stream_ru - 03-30-2010 10:40 AM

1. Upload, unpack, copy to ispcp folder
2. Chekc permission and owners
3. crontab -e

*/1 * * * * /var/www/ispcp/engine/rrd/resourses.sh >/dev/null 2>&1
*/1 * * * * /var/www/ispcp/engine/rrd/netstat.sh >/dev/null 2>&1
*/1 * * * * /var/www/ispcp/engine/rrd/memory.sh >/dev/null 2>&1
*/4 * * * * /var/www/ispcp/engine/rrd/hdd_usage.sh >/dev/null 2>&1
*/3 * * * * /var/www/ispcp/engine/rrd/speed_fan.sh >/dev/null 2>&1
*/2 * * * * /var/www/ispcp/engine/rrd/temp_cpu.sh >/dev/null 2>&1
*/2 * * * * /var/www/ispcp/engine/rrd/temp_hdd.sh >/dev/null 2>&1

4. yum install rrdtool lm_sensors net-snmp net-snmp-utils hddtemp

5. edit /etc/snmp/snmpd.conf and ad your data
PHP Code:
syslocationMain
sysservices 0
syscontact root
(dog)domain.tld

#rwcommunity rumata 127.0.0.1
#rocommunity 127.0.0.1/24

master yes

#pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat

#sysservices 76
sysservices 31region

rocommunity superpublic 
#PASSWORD!
#com2sec public default public
#group public v2c public
#access public "" any noauth exact all none none

disk /
disk /var
disk /dev/shm 

6. service snmpd start

7. Lets adding new pages to menu
add to admin/menu_statistics.tpl after codes
<tr>
<td height="3" width="193"><img src="{THEME_COLOR_PATH}/images/top/menu_separator.jpg" height="3" width="193" alt="" /></td>
</tr>

PHP Code:
<tr>
     <
td><a href="graph_cpu.php" class="submenu">{TR_MENU_CPU_GRAPH}</a></td>
    </
tr>
    <
tr>
     <
td height="3" width="193"><img src="{THEME_COLOR_PATH}/images/top/menu_separator.jpg" height="3" width="193" alt="" /></td>
    </
tr>
    <
tr>
     <
td><a href="graph_mem.php" class="submenu">{TR_MENU_MEM_GRAPH}</a></td>
    </
tr>
    <
tr>
     <
td height="3" width="193"><img src="{THEME_COLOR_PATH}/images/top/menu_separator.jpg" height="3" width="193" alt="" /></td>
    </
tr>
    <
tr>
     <
td><a href="graph_hddusage.php" class="submenu">{TR_MENU_HDD_GRAPH}</a></td>
    </
tr>
    <
tr>
     <
td height="3" width="193"><img src="{THEME_COLOR_PATH}/images/top/menu_separator.jpg" height="3" width="193" alt="" /></td>
    </
tr>
    <
tr>
     <
td><a href="graph_netstat.php" class="submenu">{TR_MENU_NET_GRAPH}</a></td>
    </
tr>
    <
tr>
     <
td height="3" width="193"><img src="{THEME_COLOR_PATH}/images/top/menu_separator.jpg" height="3" width="193" alt="" /></td>
    </
tr>
    <
tr>
     <
td><a href="graph_temp.php" class="submenu">{TR_MENU_TEMP_GRAPH}</a></td>
    </
tr>
    <
tr>
     <
td height="3" width="193"><img src="{THEME_COLOR_PATH}/images/top/menu_separator.jpg" height="3" width="193" alt="" /></td>
    </
tr>
    <
tr>
     <
td>&nbsp;</td>
    </
tr

8. add to /var/www/ispcp/gui/include/admin-functions.php
after line 'TR_MENU_SERVER_STATISTICS' => tr('Server statistics'),
new lines:
'TR_MENU_CPU_GRAPH' => tr('CPU Load'),
'TR_MENU_MEM_GRAPH' => tr('Memory Usage'),
'TR_MENU_HDD_GRAPH' => tr('HDDs Usage'),
'TR_MENU_NET_GRAPH' => tr('Ehernet Speed'),
'TR_MENU_TEMP_GRAPH' => tr('Termal Graphic'),

9. use
#/usr/sbin/sensors-detect
for automatic sensors detecting for you MainBoard
If you have any problems whith detect sensors, use
#lspci
#man dmidecode
for get information about your chipset
and meybe you have found config at thise page
http://www.lm-sensors.org/wiki/Configurations

NOTE - In same mainboard not all sensors is worked Sad

8. goto Admin area and get pleasure!

Known Problem
If you use
#services network restart
instead reboot
meybe you have a wrong network statistics

P/S Made in Russia, Moscow Wink
Data-Stream Web Service Provider
What are opinions and suggestions?
It may make the increase of small plots by clicking the mouse?
Or the inclusion of statistics to show resellers (by setup page)? This will avoid the stupid questions to tech support on the server load.


RE: Graphical Statistics whith RRD-tools - TheCry - 03-30-2010 03:34 PM

Great work from russia!!!
I like rrdtool and you make my day with your solution!!!
I think there is more capability to create a own ispCP serverhealth overview!


RE: Graphical Statistics whith RRD-tools - gOOvER - 03-30-2010 03:52 PM

For Debian use:
Code:
aptitude install snmp hddtemp rrdtool wmtemp wmgtemp
Hope, i have all Smile

Maybe it's possible to integrate also:
http://collectd.org


RE: Graphical Statistics whith RRD-tools - data-stream_ru - 03-30-2010 06:35 PM

At now I work whith parsing nginx and Apache stat.
And second I vant to show cpu by nice, proc, system, idle
At next I have a plane FlowScan integration
http://www.caida.org/tools/utilities/flowscan/analysis.xml

But I haven't planes to concurent thith cacti and other hi-end packages Smile
They can be instaled separately.

Ours solution for easy integration and no porblem to heve. This is the first task. Then we and you can develop.

2All: Please, see HDD speed stat. Maybe an error in counting. Or maybe not...


RE: Graphical Statistics whith RRD-tools - Nuxwin - 03-30-2010 07:03 PM

Hello

Oh god, I like this. Tested on Debian ?

Thank a lot for your great work here.


RE: Graphical Statistics whith RRD-tools - data-stream_ru - 03-30-2010 07:46 PM

Hi!
Its OS independent.
But you can meet a problem whith your mainboard sensors or snmpd.
Some mainboard's sensor work incorrect, and some don't detected.
I have thise problem in MCI mainboard whith AMD Althon 2core.

See comments in sh files. In some cases, suggested two solutions.
Oh, I forgot ...
For 1Gb Ethernet switch to be 64x counters. See comments in netstat.sh


RE: Graphical Statistics whith RRD-tools - data-stream_ru - 03-31-2010 08:42 AM

There is a bug in the archive:
/omega_originl/ -> /omega_original/
There is a bug in the temp_cpu.sh :
replace
core0=`echo core1/1000| bc`
core1=`echo core1/1000| bc`
to
core0=`echo $core0/1000| bc`
core1=`echo $core1/1000| bc`


RE: Graphical Statistics whith RRD-tools - data-stream_ru - 03-31-2010 08:31 PM

New version whith Apache and nginx HTTP-servers statistics

Improved CPUs stat.
Removed bugs

For upgrate remove old database /rrd/bd/resoures.rrd

Aditional instraction

3. crontab -e

*/1 * * * * /var/www/ispcp/engine/rrd/resourses.sh >/dev/null 2>&1
*/1 * * * * /var/www/ispcp/engine/rrd/netstat.sh >/dev/null 2>&1
*/1 * * * * /var/www/ispcp/engine/rrd/memory.sh >/dev/null 2>&1
*/4 * * * * /var/www/ispcp/engine/rrd/hdd_usage.sh >/dev/null 2>&1
*/3 * * * * /var/www/ispcp/engine/rrd/speed_fan.sh >/dev/null 2>&1
*/2 * * * * /var/www/ispcp/engine/rrd/temp_cpu.sh >/dev/null 2>&1
*/2 * * * * /var/www/ispcp/engine/rrd/temp_hdd.sh >/dev/null 2>&1
*/2 * * * * /var/www/ispcp/engine/rrd/nginx-collect >/dev/null 2>&1
*/5 * * * * /var/www/ispcp/engine/rrd/nginx-graph >/dev/null 2>&1 #optional for nginx http-server
*/3 * * * * /var/www/ispcp/engine/rrd/apache.sh >/dev/null 2>&1 #optional for nginx http-server

9. Edit /etc/httpd/httpd.conf
LoadModule status_module modules/mod_status.so

ExtendedStatus On

<Location /serverstatus>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1 78.46.102.101
</Location>

10.
#service httpd reload

11. add points to menu
admin/menu_statistics.tpl

<tr>
<td><a href="graph_nginx.php" class="submenu">nginx</a></td>
</tr>
<tr>
<td height="3" width="193"><img src="{THEME_COLOR_PATH}/images/top/menu_separator.jpg" height="3" width="193" alt="" /></td>
</tr>
<tr>
<td><a href="graph_apache.php" class="submenu">Apache</a></td>
</tr>
<tr>
<td height="3" width="193"><img src="{THEME_COLOR_PATH}/images/top/menu_separator.jpg" height="3" width="193" alt="" /></td>
</tr>

------- optionaly for nginx ---------

12. add to nginx.conf in server directive (server with panel)

location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}

You can add this location on each domain and subdomain that you watn to monitoring. Into vhosts.conf
Plots shows automaticaly if preasent

13. Edit ispcp/engine/rrd/nginx-rrd.conf

You can add to constant SERVERS_URL all ips and domains wich our want to minitoring

14. service nginx reload
if you have an eroor recompile nginx whith option
--with-http_stub_status_module

15. test
#GET http://localhost/nginx_status

Its all.


RE: Graphical Statistics whith RRD-tools - data-stream_ru - 04-12-2010 07:43 PM

Any reports?


RE: Graphical Statistics whith RRD-tools - TheCry - 04-12-2010 08:26 PM

Sorry... I did not have any time to test this...
On wednesday i will include it on my testsystem...
I think on friday i can give you some reports!