Netstat
Moderators: Developers, Moderators
Netstat
EDIT: Updated to use snmpnetstat
Here's a netstat graph I made for linux.
Steps to install:
1. Copy netstat.sh to %CACTI_HOME%/scripts/ (for me this is /var/www/cacti), and make sure it is executable.
2. Import template into cacti, and start graphing.
You will need to provide the community string when creating the graph, unless someone can tell me how to automatically pass that to a script-type data input.
Unfortunately, I was unable to make it completely SNMP based so I had to wrap snmpnetstat in a shell script; some of my network devices did not have the correct OIDs as described by Howie, but this script input works correctly for Windows, Linux, BSD, and even some network devices!
Enjoy!
This is all released under GPL2 so do what you want with it.
Here's a netstat graph I made for linux.
Steps to install:
1. Copy netstat.sh to %CACTI_HOME%/scripts/ (for me this is /var/www/cacti), and make sure it is executable.
2. Import template into cacti, and start graphing.
You will need to provide the community string when creating the graph, unless someone can tell me how to automatically pass that to a script-type data input.
Unfortunately, I was unable to make it completely SNMP based so I had to wrap snmpnetstat in a shell script; some of my network devices did not have the correct OIDs as described by Howie, but this script input works correctly for Windows, Linux, BSD, and even some network devices!
Enjoy!
This is all released under GPL2 so do what you want with it.
- Attachments
-
- netstat.sh
- This goes in %CACTI_HOME%/scripts. Make sure it is executable with chmod +x or owned by cacti.
- (341 Bytes) Downloaded 981 times
-
- cacti_graph_template_ucdnet_-_snmpnetstat.xml
- Exported with 0.8.7a
- (26.21 KiB) Downloaded 1003 times
-
- Fancy screenshot.
- netstat.png (37.04 KiB) Viewed 12002 times
Last edited by pheezy on Mon Dec 10, 2007 9:57 pm, edited 1 time in total.
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
If you're already running net-snmp snmpd on the remote machines, then you can get most of the same info from snmpnetstat:
which in turn suggests that there are probably real OIDs for it too, which is a whole lot more efficient than an exec. And works on non-linux too, even non-Unix.
Just saying.
Edit: This is the MIB that snmpnetstat uses.
Code: Select all
snmpnetstat -v 1 -c public -Cs myserver
Just saying.
Edit: This is the MIB that snmpnetstat uses.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
-
- Posts: 11
- Joined: Wed Feb 11, 2009 12:59 pm
- Contact:
Yes, the hash table error is what you get when you try to import a template exported from a newer ver of Cacti than what you're running'artiflo wrote:I have an error when I try to import the template "Error: XML: Hash version does not exist."?
You can only import "up," to a newer version of Cacti, not "down"
-
- Posts: 11
- Joined: Wed Feb 11, 2009 12:59 pm
- Contact:
-
- Posts: 11
- Joined: Wed Feb 11, 2009 12:59 pm
- Contact:
Re: Netstat
Here's a screenshot of my modified Data Input Method, that shows how to pass the snmp community string so you don't have to enter it in for every device added... the "special type code" is what does the trick:pheezy wrote:EDIT:You will need to provide the community string when creating the graph, unless someone can tell me how to automatically pass that to a script-type data input.
- Attachments
-
- snmpnetstat.png (45.07 KiB) Viewed 9090 times
-
- Posts: 11
- Joined: Wed Feb 11, 2009 12:59 pm
- Contact:
Here's my modified templates, for those like me who are truly lazy and just want to import templates
This was exported from Cacti 0.8.7d
This was exported from Cacti 0.8.7d
- Attachments
-
- cacti_graph_template_ucdnet_-_snmpnetstat.xml
- (24.29 KiB) Downloaded 301 times
Hello,
I am not sure I understood: besides the xml template file, do I need to download something else? Cause I downloaded and imported it, everything looked fine, but the graph displays only nan values.
Then I checked Data sources for the monitored host and discovered that there's only one data source. Is this ok?
Thank you!
I am not sure I understood: besides the xml template file, do I need to download something else? Cause I downloaded and imported it, everything looked fine, but the graph displays only nan values.
Then I checked Data sources for the monitored host and discovered that there's only one data source. Is this ok?
Thank you!
- Attachments
-
- netstat.png (46.05 KiB) Viewed 9073 times
Since Netstat pulls from the RFC1213 MIB, you all realize a snmp script/templates have already been created for it -- including TCP stats?
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
-
- Posts: 11
- Joined: Wed Feb 11, 2009 12:59 pm
- Contact:
Wow... that's really in-depth. No I'd just been searching the forum for netstat and this was the first thread I'd come across. Thanks.BSOD2600 wrote:Since Netstat pulls from the RFC1213 MIB, you all realize a snmp script/templates have already been created for it -- including TCP stats?
-
- Posts: 11
- Joined: Wed Feb 11, 2009 12:59 pm
- Contact:
kido: if you're still trying to get this version to work, did you copy the netstat shell script to your cacti/scripts folder?kido wrote:Hello,
I am not sure I understood: besides the xml template file, do I need to download something else? Cause I downloaded and imported it, everything looked fine, but the graph displays only nan values.
Who is online
Users browsing this forum: No registered users and 1 guest