Mufamba
Hacker
- Registriert
- 2. September 2009
- Beiträge
- 370
- Reaktionspunkte
- 67
- Punkte
- 88
Moin moin, ich bin grade dabei mit RRD die CCcam infopage auszulesen um mir die daten über munin darstellen zu lassen.
Hier geht es in erster linie darum peaks zu erkennen um einen gewissen überblick über die server aktivtät zu erlagen.
Ich teste derzeit ein script bzw. tut von einer anderen page, aber hier bekomme ich jedesmal beim auslesen einen Fehler.
Leider bin ich mit der RRD Programierung nicht sonderlich vertraut und mir fehlen somit die nötigen komandos bzw. deren bedeutung um an dem script was zu ändern . . .
Vielleicht findet sich je ja jemand der sich damit ein bischen auseinander gesetzt hat und weiter hilft . .
Danke im voraus.
Hier mal das Script was ich teste:
Hier geht es in erster linie darum peaks zu erkennen um einen gewissen überblick über die server aktivtät zu erlagen.
Ich teste derzeit ein script bzw. tut von einer anderen page, aber hier bekomme ich jedesmal beim auslesen einen Fehler.
Leider bin ich mit der RRD Programierung nicht sonderlich vertraut und mir fehlen somit die nötigen komandos bzw. deren bedeutung um an dem script was zu ändern . . .
Vielleicht findet sich je ja jemand der sich damit ein bischen auseinander gesetzt hat und weiter hilft . .
Danke im voraus.
Hier mal das Script was ich teste:
Quelle: ECSMunin is a network/system monitoring application that presents output in graphs through a web interface. Its emphasis is on simple plug and play capabilities. A large number of monitoring plugins are available. Using Munin you can easily monitor the performance of your computers, networks, SANs, and applications as well. It uses the RRDtool (written by Tobi Oetiker) and is written in Perl. It stores the data in RRD files, and (if needed) updates the graphs. One of the main goals has been ease of creating new plugins (graphs).
Munin is available as a package in most distros. In Ubuntu for example, to install it, just type: sudo apt-get install munin.
With the plugins below, you can very easily monitor vairous CCcam parameters along the many others inside your Munin installation on your Linux system.
If you use Ubuntu, go to /usr/share/munin/plugins/ (other distros may have some other location for this) and create there a file called cccam_cards
Paste the following text in the file, then save it:
Code:
#!/bin/sh
case $1 in
config)
cat <<'EOM'
graph_title CCcam available cards
graph_vlabel cards
graph_category CCcam
hop1.label Cards in hop1
hop2.label Cards in hop2
hop3.label Cards in hop3
hop4.label Cards in hop4
EOM
exit 0;;
esac
echo -n "hop1.value "
echo shares | nc localhost 16000 | grep "|1 " | wc -l
echo -n "hop2.value "
echo shares | nc localhost 16000 | grep "|2 " | wc -l
echo -n "hop3.value "
echo shares | nc localhost 16000 | grep "|3 " | wc -l
echo -n "hop4.value "
echo shares | nc localhost 16000 | grep "|4 " | wc -l
Paste this into a new file, cccam_servers_clients:
Code:
#!/bin/sh
case $1 in
config)
cat <<'EOM'
graph_title CCcam Servers and Clients
#graph_vlabel CCcam
graph_category CCcam
clients.label Connected clients
aclient.label Active clients
servers.label Server connections
EOM
exit 0;;
esac
echo -n "clients.value "
echo info | nc localhost 16000 | grep Connected | awk '{print $3}'
echo -n "aclient.value "
echo info | nc localhost 16000 | grep 'Active clients' | awk '{print $3}'
echo -n "servers.value "
echo servers | nc localhost 16000 | grep 'Server connections' | awk '{print $3}'
Paste this into a new file, cccam_shares_ecm:
Code:
#!/bin/sh
case $1 in
config)
cat <<'EOM'
graph_title CCcam Shares and ECM
#graph_vlabel cccam
graph_category CCcam
shares.label Available shares
ecms.label Total handled client ecms
EOM
exit 0;;
esac
echo -n "shares.value "
echo shares | nc localhost 16000 | grep Available | awk '{print $3}'
echo -n "ecms.value "
echo info | nc localhost 16000 | grep ecm | awk '{print $5}'
Make these files executable (change permissions with chmod to 755).
Create symlinks for each file to folder /etc/munin/plugins.
Restart munin: sudo service munin-node restart. Sit back and relax for 15 minutes, and look at your graphs growing.
Lots of parameters of CCcam can be monitored. Based on the code above, with simple modifications almost anything can be graphed.
Any other plugin suggestions?