LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-17-2010, 10:01 AM   #1
rojoblandino
LQ Newbie
 
Registered: Nov 2007
Distribution: SuSE Debian
Posts: 22

Rep: Reputation: 0
Question php and snmp


Hi guys i was trying mrtg, but when the light go off the graphics get distorted. Trying to adjust the conf files i get nothing than trying rrdtool but i keep having the same problems.

So i was thinking to use php, i got working php snmp walk function but i am looking the way to get the bandwidth or usage of the device from snmp or any snmp function but still now i keep searching.

Once done this stages i would be able to save the data into an array and the plot it into a graph and personalize the max and min values for avoiding distorted graphs.

Any Idea?
 
Old 06-18-2010, 10:30 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by rojoblandino View Post
Hi guys i was trying mrtg, but when the light go off the graphics get distorted. Trying to adjust the conf files i get nothing than trying rrdtool but i keep having the same problems.

So i was thinking to use php, i got working php snmp walk function but i am looking the way to get the bandwidth or usage of the device from snmp or any snmp function but still now i keep searching.

Once done this stages i would be able to save the data into an array and the plot it into a graph and personalize the max and min values for avoiding distorted graphs.
Any Idea?
No...can't follow what you're saying: "trying mrtg, but when the light go off the graphics get distorted"????? What?????

Then you mention PHP and snmpwalk...are you writing your own code? Using what to store the data and graph it?? No idea what your problem is, or what you're trying to do. Best I can figure out, you're trying to graph network utilization. MRTG is the best way to go...if your rrd files got corrupted, then remove and regenerate them, and continue.

Otherwise, you can easily set up Nagios, Zenoss, Big Brother, or any other PHP/web based monitoring tools for bandwith monitoring.
 
Old 06-24-2010, 10:24 AM   #3
rojoblandino
LQ Newbie
 
Registered: Nov 2007
Distribution: SuSE Debian
Posts: 22

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
No...can't follow what you're saying: "trying mrtg, but when the light go off the graphics get distorted"????? What?????

Then you mention PHP and snmpwalk...are you writing your own code? Using what to store the data and graph it?? No idea what your problem is, or what you're trying to do. Best I can figure out, you're trying to graph network utilization. MRTG is the best way to go...if your rrd files got corrupted, then remove and regenerate them, and continue.

Otherwise, you can easily set up Nagios, Zenoss, Big Brother, or any other PHP/web based monitoring tools for bandwith monitoring.
I have test Nagios, MRTG, Zenoss but none of them solve my problem, my problem is that i can not see the values because the mrtg show a line of 10 MB being the connection of 128kbps so you do not see anything, and erasing the graph does not solve my problem, it get worst because i lost the information, so i just need to get the values of badnwidth.

Of course i am going to save the data somewhere, but i still have doubts and the help in the php home site is a little poor that i can not find the function that would allow me to get the bandwidth value of the device.

Getting that the programation is not problem, my question is what funcions i need to use to get the bandwidth i can not find it on AltaVista or Google.

P.D.: I have tryied to set the MaxValue1 and MaxValue2 and still show the high Lines and distroted the graphic to little lines that you see nothing, just the line, so i am decide to do my script that will respect my MaxValue and if the value is hight than that will not grhaphic or will make a mod(value,MAxvalue) or something like that in gcc it would be something like v2graph=(val%MaxValue); That will allow me to always show the value but will not distorted it and if is mor thant the MaxValue will start from the bottom of the graph.

Last edited by rojoblandino; 06-24-2010 at 10:30 AM.
 
Old 06-25-2010, 05:55 AM   #4
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by rojoblandino View Post
I have test Nagios, MRTG, Zenoss but none of them solve my problem, my problem is that i can not see the values because the mrtg show a line of 10 MB being the connection of 128kbps so you do not see anything, and erasing the graph does not solve my problem, it get worst because i lost the information, so i just need to get the values of badnwidth.

Of course i am going to save the data somewhere, but i still have doubts and the help in the php home site is a little poor that i can not find the function that would allow me to get the bandwidth value of the device.

Getting that the programation is not problem, my question is what funcions i need to use to get the bandwidth i can not find it on AltaVista or Google.

P.D.: I have tryied to set the MaxValue1 and MaxValue2 and still show the high Lines and distroted the graphic to little lines that you see nothing, just the line, so i am decide to do my script that will respect my MaxValue and if the value is hight than that will not grhaphic or will make a mod(value,MAxvalue) or something like that in gcc it would be something like v2graph=(val%MaxValue); That will allow me to always show the value but will not distorted it and if is mor thant the MaxValue will start from the bottom of the graph.

i *think* i get what you are saying.
add the MaxBytes directive.

In case i am wrong, please show your mrtg.cfg file.
 
Old 06-30-2010, 12:41 PM   #5
rojoblandino
LQ Newbie
 
Registered: Nov 2007
Distribution: SuSE Debian
Posts: 22

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by centosboy View Post
i *think* i get what you are saying.
add the MaxBytes directive.

In case i am wrong, please show your mrtg.cfg file.
Here it is
Code:
EnableIPv6: no
WorkDir: /srv/virtual/mrtg-dir

RunAsDaemon: Yes
Language: spanish

WithPeak[_]: dwmy
options[_]: growright, bits, transparent, avgpeak, unknaszero, noborder, pngdate
XSize[_]: 600
YSize[_]: 200
XScale[_]:1.8
YScale[_]:1.5
YTics[_]:12
Unscaled[_]: dwmy
MaxBytes[_]: 128000
But as i have said before the MaxBytes are not working, here i am setting to 1M but when the light go off the mrtg show a line of 10M or more, so the graphics get distorted, i do not want to get distorted graphs and erasing the data do not solve my problem.

Also you can see that Unscaled is set to all, it works when is less than 1M, for example the Y values show the 1M and if 128kbps are being send i can see the 128kbps and the blank space to reach 1M but if more than 1M is sent, for example if light go off a pulse is produced and more than 1M is recieve in the network cards, then it scale the graph, even with the option unscaled, it seems that unscaled work well for values under MaxBytes not over it.

So i am trying to do it by my self to get the values through php save the datas into a file or database and then graph the content, if value is higher than limit do not graph or do something like ($val % limit) it will take the mod of the value and will start from bottom, any way, to do it i have not found how to get the MIB values through php functions, anybody can help me, i am still reading and nothing found.

Thanks.
 
  


Reply

Tags
php, snmp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SNMP and PHP on opensuse 11.1 mossy464 Linux - Software 1 03-25-2010 02:55 PM
Net-SNMP writing a Subagent - snmp.conf Unknown token: master AustinMarton Programming 0 12-16-2008 07:34 PM
SNMP from PHP batatudo Programming 2 03-19-2004 10:11 PM
snmp / php BaerRS Linux - Networking 2 04-21-2003 08:31 AM
snmp (ucd-snmp, net-snmp) markus1982 Linux - Software 1 11-21-2002 10:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration