uPnP MRTG Gaat dat werken?

Pagina: 1
Acties:

  • om3ega
  • Registratie: Maart 2001
  • Laatst online: 17-08 20:13
Omdat mijn Alcatel Speedtouch 510 v4 geen SNMP ondersteunt ;( ben ik op zoek naar andere manieren om de status van dat ding uit te lezen voor MRTG.

Er zijn 2 manieren denk ik , maar van beide weet ik niet precies hoe ik het aan moet pakken.

Ik kan inloggen via Telnet op het modem en via IP IFLIST een lijst opvragen. Die ziet er zo uit :

code:
1
2
3
4
5
6
=>ip iflist
Interface       GRP MTU   RX       TX       TX-DROP  STATUS       HWADDR
0  loop         1   1500  0        0        0          UP
1  eth0         2   1500  2587306  11198871 0          UP   00:90:d0:83:11:1f
2  BBned        0   1500  10828552 2100959  0          UP   00:90:d0:83:11:1f
=>


Maar ook ondersteunt het modem UPnp .. kan ik daar iets mee?
Ik wil dus zien hoeveel data verkeer er door mijn modem naar buiten is gegaan en dit weergeven in MRTG.

  • FatalError
  • Registratie: Juni 1999
  • Laatst online: 17-08 23:07
nee, upnp heb je niets aan in jouw geval :)

If it ain't broken, tweak it! | gasloos sinds oktober 2025, hoekwoning 1978 | 10kWp PV, Panasonic K serie 7kW, Atlantic Explorer V5 270L | Tesla Model Y | 3x Victron MP2 6k5, 48kWh


  • om3ega
  • Registratie: Maart 2001
  • Laatst online: 17-08 20:13
Maar die andere methode? Kan ik daar wat mee denk je?

  • ripexx
  • Registratie: Juli 2002
  • Laatst online: 17-08 20:40

ripexx

bibs

Natuurlijk kan je dit doormiddel van een perl/php/vb script omzetten naar een formaat wat door MRTG kan worden ingelezen. Dus eens in de x tijd de data ophalen en in een txt file zetten welke door MRTG kan worden gelezen. Je zult alleen wat moeten proggen, ligt ook een beetje aan het systeem waar je nu op draait. :)

buit is binnen sukkel


  • om3ega
  • Registratie: Maart 2001
  • Laatst online: 17-08 20:13
Ik draai nu Redhat 9.0 ,
dat PHP script zal wel lukken.. Maar ik moet alleen even kijken hoe ik dat dan weer in MRTG ga dumpen :)

(dus in welk formaat hij het wil zien) :)

  • ripexx
  • Registratie: Juli 2002
  • Laatst online: 17-08 20:40

ripexx

bibs

Als je MRTG runt als daemon dan kan je ook via externe bronnen info als input gebruiken. Qoute je van www.mrtg.org | http://people.ee.ethz.ch/...tools/mrtg/reference.html
External Monitoring Scripts

If you want to monitor something which does not provide data via snmp you can use some external program to do the data gathering.
The external command must return 4 lines of output:

Line 1

current state of the first variable, normally 'incoming bytes count'

Line 2

current state of the second variable, normally 'outgoing bytes count'

Line 3

string (in any human readable format), telling the uptime of the target.

Line 4

string, telling the name of the target.

Depending on the type of data your script returns you might want to use the 'gauge' or 'absolute' arguments for the Options keyword.

Example:

Target[ezwf]: `/usr/local/bin/df2mrtg /dev/dsk/c0t2d0s0`Note the use of the backticks (`), not apostrophes (') around the command.

If you want to use a backtick in the command name this can be done but you must escape it with a backslash ...

If your script does not have any data to return but does not want mrtg to complain about invalid data, it can return 'UNKNOWN' instead of a number. Note though that only rrdtool is realy equipped to handle unknown data well.
Zo'n script kun je makkleijk maken via php of perl, ook php kan via de command line worden aangeroepen dus dat mag niet zo'n probleem zijn.

buit is binnen sukkel


  • om3ega
  • Registratie: Maart 2001
  • Laatst online: 17-08 20:13
Hey bedankt.. Ik ga eens een script in elkaar neuzelen!
Ik had over dat daemon stukje heen gelezen.. gelijk ff doen :)
Pagina: 1