MRTG-Alternative? (Daten sammeln + anzeigen mit rrdtool und collectd)

Vorerst ohne collectd?

Ich habe gestern mit Udos Angaben collectd zur Zusammenarbeit zu bewegen versucht, wobei mein Zustand von :confused: bis zu :mad: (in den frühen Morgenstunden) wechselte. Da die meisten von uns wohl endlich mal ein paar Grafiken wollen, die sich ohne Akrobatik einfach per ds-mod Paket einbinden lassen, möchte ich collectd links liegen lassen :abschied: und schweren Herzens doch mit Skripts zu arbeiten. Alexander hat in #43 ja die saubere Art bestens dokumentiert, da beim direkten Zugriff (z.B. via ifconfig dsl) je nach Messwert durchaus mal Mist daherkommt. "Wer misst misst Mist" ist zwar 'ne alte Ingenieurweisheit, aber systematisch kreuzfalsch muss es ja auch nicht gleich sein. Trick
 
Hi,

ich habe gerade zufaellig diese Diskussion gefunden. Schade, dass ihr eure Probleme nicht mal auf der Mailingliste geschildert oder im IRC vorbeigeschaut habt - wir haetten euch gerne geholfen.

Udo, bei deinem strace ist mir aufgefallen, dass mehrfach nachgesehen wird, ob das Verzeichnis /usr/lib/collectd existiert - jedes mal mit einem negativen Ergebnis. Anscheinend kann der Daemon keine Plugins laden. Dafuer gibt es die Config-Option ,,PluginDir''. Aber so wie der Beitrag vom 7. Oktober klingt hast du beim Bauen von collectd die Plugins nicht gleich mitgebaut?

Fehler- und Logmeldungen gibt es nur, wenn ein entsprechendes Plugin geladen wurde, zur Zeit sind das die Plugins `syslog' und `logfile'. RRD-Dateien koennen nur geschrieben werden, wenn das `rrdtool' Plugin erfolgreich geladen wurde. Ihr koennt ja auch erstmal das `csv' Plugin ausprobieren, das hat keine so ekligen Bibliotheksabhaenigkeiten. Ich denke allerdings, dass ich weder das `rrdtool' noch das `csv' Plugin gebaut und in das ipkg gepackt habe, weil RRD-Dateien nicht direkt Flash-freundlich sind. Die Wrt-Systeme verschicken ihre Daten mit dem `network' Plugin - in Dateien geschrieben werden sie dann woanders. Im Zweifelsfall muesst ihr die Existenz des ,,Shared Object'' ueberpruefen.

Viele Gruesse,
-octo
 
Falls das für euch interessant sein könnte:

Ich habe vor längerer Zeit mal die OpenWRT Version von Munin-node auf die Box gehaun.
Mit ein paar Anpassungen läuft sie recht gut.

Nachteil: microperl und inetd werden benötigt.

Wenn Interesse besteht kann ich es mal packen und veröffentlichen.
 
Ja, aber immer doch! :)
 
Ich auch, klares ja.
 
Nagut, dann werd ich mal auf meiner Box suchen wos grad liegt und wie der stand is.

Ich meld mich sobald ichs gefunden hab :)

EDIT:

Soo, habs zwischenzeitlich gefunden :)
Runterladen könnt ihr das Paket hier:

http://www.dabecka.de/munin.tar.gz

Darin enthalten sind:
microperl
munin-node
sowie diverse Plugins

Wie gesagt, es benötigt den Inetd aus dem ds-mod.

Um es zum laufen zu kriegen müsst ihr folgendes in die /etc/inetd.conf schreiben:
Code:
4949    stream  tcp     nowait  root    /var/tmp/munin/munin-node

Die Trenner sind Tabs.
Danach müsst ihr ihn über das init Script neustarten.

Ich habe es leider nicht geschafft, das automatisch zu machen.
Wenn ich es genauso automatisch einfüge erscheint folgende Fehlermeldung im Syslog:
Code:
Nov 21 23:08:55 fritz user.err syslog: execv /var/tmp/munin/munin-node: No such file or directory

Manuell geht es allerdings.

Falls fragen sind, meldet euch!

Viele Grüße,
Christian

EDIT2:
Die ursprüngliche Version kommt von OpenWRT.
Die original Version gibts hier: http://nion.modprobe.de/blog/archiv...linksys-wrt54g-and-OpenWRT-kamikaze-7.07.html, danke Felix für den Link ;)
Ich habe allerdings einige Anpassungen vorgenommen (mircoperl, wlan im dhcpleases, und vermutlich noch ein paar mehr).
 
Zuletzt bearbeitet:
Alpha Version

Nach dem Frust mit collectd habe ich halt zähneknirschend :mad: das Abfüllen der Messdaten per Skript codiert.

Für die Unerschrockenen:

Das Archiv mit den Skripten am besten ins /var entpacken und das Polling im Hintergrund mit /var/polling.sh & starten (evtl. noch ein chmod +x auf allen Skripten). Bei kleineren Systemen (7050) empfehle ich, im polling.sh die Zeile mit line.sh zu löschen. Es spart ca. 700k RAM und viel Rechenzeit.

Dann heisst ein paar Minuten warten. Die rrd-Files mit den Messdaten werden vom polling.sh ebenfalls im /var erstellt; mit 30 Sekunden Messintervall.

Die Einbindung ins Web-GUI habe ich noch nicht vorgenommen: Das Archiv mit dem CGI-File testweise ins /var auspacken und stats.cgi (evtl. noch ein chmod +x) per Kommando ausführen. Da auf diese Weise keine Übergabe der Zeitspanne erfolgt, schreibt das Skript eine Anzeigeperiode von 2 Stunden ("2h") vor. Beim Aufruf per Web-GUI braucht es das nicht mehr. Die Grafiken werden gegenwärtig im /tmp erstellt und können dort bestaunt werden.

Wenn ich in den nächsten Tagen nicht gelyncht oder mit Wünschen zugemüllt werde, folgt die Einbindung in GUI und im crond. Beim GUI bin ich für sachdienliche Hinweise und Tricks sehr empfänglich.
Gruss Trick
 

Anhänge

  • scripts.tar.gz
    1.8 KB · Aufrufe: 45
  • cpu.PNG
    cpu.PNG
    28.7 KB · Aufrufe: 112
  • line.png
    line.png
    36.5 KB · Aufrufe: 85
  • memory.png
    memory.png
    36.3 KB · Aufrufe: 67
  • wan.png
    wan.png
    28.8 KB · Aufrufe: 85
  • signal.png
    signal.png
    29.2 KB · Aufrufe: 86
  • cgi.tar.gz
    2.1 KB · Aufrufe: 40
Zuletzt bearbeitet:
Könnte jemand mal bitte ein kleines Archiv mit den Binaries für rrdtool inkl. der benötigten Bibliotheken zusammenbauen?

Bei mir wird bei der Erzeugung von Grafiken der Fehler: rrdtool: can't resolve symbol 'mbstowcs' ausgegeben.

Danke

Steffen
 
The cpu, memory and wan status work with me, but the dsl line status doesn't work, because i am using the international version of the 7140, and scripts keep all values set at "NaN", any possible fix?
 
hi ramik,
nothing to worry about! The naming convention for the DSL interface is rather arcane. Try to run ifconfig to find a suitable interface name and substitute it in the heading section of the script as the name for the WAN interface instead of “DSL”. I anticipated diverging naming.

If you can't get by, just post the output of your ifconfig and I'll gladly assist you.
Cheers Trick
 
it's not the ifconfig wan that doens't work (even though that results seem strange, i have windows download at 200kb/s and the graph shows 10kb upstream, 20kb downstream.

it's the line status and xdsl status (the one in db) and line capacity (bits/s), those who use query.txt thing.....
 
That's ugly, really ugly. I painstakingly followed Alexander’s advice in post #43 to get all the measurements off the web interface, as the built-in command (/proc/avalanche/avsar_modem_stats) is severely hamstrung. As it appears, my 7170 has a different parameter naming than your 7140.

Since I’d like to have a cross-product solution, I’ll give the matter some more thought and also have a look at the source regarding the avsar_modem_stats. Moving away from the web query is also performance-wise not too bad an idea.
Trick
 
I saw that my real dsl usage bandwidth is reported through the cpmac0 interface, and not wan or dsl through the ifconfig... :noidea:
 
The issues regarding in the inaccuracy of the DSL interface have been widely reported. The crucial point is that I could get the information off the web GUI, which to my knowledge is indeed accurate. The flip side however is that the interoperability between the models is severely hampered by such an approach.

I'm definitely not keen on adding too many case distinctions. However, I could add a better parameterization for the queries and we could think about maintaining the minimal set of parameter numbers across the products and versions. I'll check out the .49 release with Freetz to see what kind of surprises there are for the plain 7170.
Trick
 
Anyway, I like this rrdtool, and i am making it more integrated into the dsmod, already added it to show 3 graphs from the extras menu, and will try to make it as package with custom configs from GUI and autostart polling data on reboot, etc.

currently i made it autorun on reboot though the rc.custom and a small install script that i made, with some extra cgi scripts for the interface that autocreate graphs upon opening.

here are some screenshots:

 
Das Archiv mit den Skripten am besten ins /var entpacken und das Polling im Hintergrund mit /var/polling.sh & starten
Super! Funktioniert. Ich musste nur zwei Libraries verlinken:

in /mod/lib:
libpng12.so.0 -> libpng12.so.0.10.0
libart_lgpl_2.so.2 -> libart_lgpl_2.so.2.3.19

Aber wie ist das mit stats.cgi? In welchem Verzeichnis müsste das liegen. Ich durchblicke das mit dem Web-Interface der Box nicht.

Udo
 
Hallo Udo,
ich bin leider kein Web-GUI-Guru. Soweit ich mir die Sache zurechtgelegt habe, werden die Seiten fürs RRD-Tool beim DS-Mod-GUI eingebunden; dies geschieht beim Erstellen vom Image. Ich habe mich aus Faulheit bisher erst am Rande damit beschäftigt und bei anderen Projekten spioniert, wie sie vorgingen. Glücklicherweise hat ramik im letzten Post schon gezeigt, dass er weiter ist als wir. Vielleicht hat er uns schon einen Grossteil der Arbeit abgenommen;).

Sobald ich Zeit finde, mit Freetz die Sache neu anzugehen, werde ich die Skripte gleich richtig ablegen und auch die Fehler beim Speicher korrigieren.
Trick
 
Here is a semi final version of my work on a data collector for rrdtool and a page to show graphs of the collected data.
i've been trying and improving it for few days now and it seems stable.

install procedure could be little tricky, as for now i have everything on the usb drive, which btw is essential to be able to keep rrd data between reboots and to be able to get graphs for up to 1 year.
unzip all contents to rrd folder on a usb, check all files to check the correct path to the various tools called.
to make it reboot-resistant, put the contents from the file rc.custom.import into the rc.custom file, this will automatically call the install.sh script each boot which will install the web interface of the package in the extras menu of the freetz interface.

for wan/adsl traffic usage, you have to check the correct interface to use, on my 7140 it seems to be the cpmac0 that shows real usage.

default view shows the graphs of cpu, memory, swap and wan usage for the last 24hours, clicking on each graph will open a page that contains the graphs of that item of the last 24 hours, 1 week, 1 month and 1 year.

waiting for feedback or any method to improve it, especially the install process for getting paths automatically in some way.
 

Anhänge

  • rrd-wan.jpg
    rrd-wan.jpg
    72.5 KB · Aufrufe: 69
  • all.jpg
    all.jpg
    79.2 KB · Aufrufe: 79
  • rrdtool-pkg.zip
    15 KB · Aufrufe: 53
Zuletzt bearbeitet:
hi ramik,
thanks for the great work. I discovered in the CPU script a minor bug, instead of
Code:
f ! [ -e $RRDPATH/$NAMEPREFIX.rrd ]; then
	StepSize=30
Code:
f ! [ -e $RRDPATH/$NAMEPREFIX.rrd ]; then
	StepSize=30[COLOR="Red"]0[/COLOR]
would be appropriate. Trick
 
where do you mean?
by mistake i left 4 extra lines in the cpu.sh script, but the rrdupdate calls the create with step of 300, (= 5 minutes), which is the same rate of polling interval, which is the correct value.

if this is what you meant, then thanks :)

updated zip above with correct cpu.sh
 

Neueste Beiträge

Statistik des Forums

Themen
244,859
Beiträge
2,219,669
Mitglieder
371,572
Neuestes Mitglied
#Kuddel#
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.