Skip to content

Commit

Permalink
SNMP-MRTG traffic monitor added
Browse files Browse the repository at this point in the history
  • Loading branch information
harp077 committed Nov 5, 2022
1 parent 522c5cb commit da3deb5
Show file tree
Hide file tree
Showing 57 changed files with 5,927 additions and 18 deletions.
84 changes: 84 additions & 0 deletions docs/mrtg_help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<h2>MRTG Console</h2>
<p>This console* is used to:</p>
<ul>
<li>remotely add/edit/update/delete monitored network
devices (routers, switches, network stations) and associated network
interfaces;

<li>remotely create daily, weekly, monthly, yearly and
custom-period traffic graphs and show them on the screen;

<li>store these graphs in PNG files.</li>
</ul>
<p>Console has two preview panes: the left (tree) pane
contains information about monitored network interfaces. The right (text) pane contains information about the selected element of the tree on the left side. Network devices (like routers and switches) are commonly denoted as 'Nodes'.</p>
<p><strong>Note: </strong> Displayed information is not constantly updated! It gets updated whenever you add, update or remove a single Node or its interface. If you want to refresh the displayed data so that it corresponds with the actual data, right click anywhere on the console or choose <em>Reload data</em> from the <em>MRTG</em> menu. However, all kind of graphs are always generated using the latest available information from the nodes.</p>

<h2>How to add a Node</h2>
<ul>
<li>From the console menu, choose <em>Node actions / Add Node...</em> New Node dialog
appears.

<li>Supply Node address (like <em>belgrade2.eunet.yu</em> or 123.000.111.222).

<li>Supply Node <em>community</em>. Communities are something like passwords
for SNMP access to the Node. If not sure about which community to use, ask
your network administrator.

<li>Supply some description of the Node if necessary
for future reference.

<li>Checkbox <em>Active</em> should
be already checked by default.

<li>Click OK. Newly defined Node appears on the left side of the screen.</li>
</ul>
<h2>How to add a network interface</h2>
<ul>
<li>Select the Node with the desired interface in the
tree pane.

<li>From the menu, choose <em>Interface actions / Add interface... </em>New interface
dialog appears.

<li>Select the desired interface from the list of all
available interfaces on the Node.

<li>Specify description if necessary for future
reference.

<li>Specify sampling interval in seconds. It represents
the amount of time that should pass before the console checks the
traffic load for the specific interface on the Node once again. Valid values
are between 10 seconds and 600 seconds (10 minutes).

<li>Checkbox <em>Active</em> should
be already checked by default.

<li>Click OK.</li>
</ul>
<p>Newly defined interface appears on the left side of the screen, probably with [-1] number added to its name. It means that MRTG console still does not know the real number of the interface on the Node. But if you reload data a few seconds later, you will probably see some positive number instead of [-1]. It means that the new interface exists on the Node. You can be sure that the traffic monitoring process has started successfully.</p>
<h2>How to create traffic graphs </h2>
<ul>
<li>Select network interface you want to create graph
for.

<li>Chose the desired graph type from the <em>Interface actions </em>menu. The following graphs can be
created with a single click: daily, weekly, monthly, yearly, last 24 hours and
custom-period graphs. The graph appears in the new frame.

<li>Click on the <em>Save</em> button to the right of the graph to save it in a PNG file format.</li>
</ul>
<p><strong>Note: </strong></p>
<ul>
<li>Graphs starting in the past and ending in the future
(graph for the current day, week, month and year, for example) are
automatically refreshed each 5 minutes. You can watch the growth of your
current daily graph - LIVE.
<li>You can open as many graph frames as you wish. All
graphs will be updated simultaneously, if necessary.

<li>Use custom graphs to create traffic graphs for arbitrary time intervals.</li>
</ul>
<br>
* This console based on JRobin MRTG
84 changes: 84 additions & 0 deletions mrtg/conf/graph_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<rrd_graph_def>
<span>
<start>${start}</start>
<end>${end}</end>
</span>
<options>
<anti_aliasing>off</anti_aliasing>
<border>
<color>#FFFFFF</color>
<width>0</width>
</border>
<title>${interface} at ${host}</title>
<vertical_label>transfer speed [bits/sec]</vertical_label>
</options>
<datasources>
<def>
<name>in</name>
<rrd>${rrd}</rrd>
<source>in</source>
<cf>AVERAGE</cf>
</def>
<def>
<name>out</name>
<rrd>${rrd}</rrd>
<source>out</source>
<cf>AVERAGE</cf>
</def>
<def>
<name>in8</name>
<rpn>in,8,*</rpn>
</def>
<def>
<name>out8</name>
<rpn>out,8,*</rpn>
</def>
</datasources>
<graph>
<area>
<datasource>out8</datasource>
<color>#00FF00</color>
<legend>output traffic</legend>
</area>
<line>
<datasource>in8</datasource>
<color>#0000FF</color>
<legend>input traffic@l</legend>
</line>
<gprint>
<datasource>out8</datasource>
<cf>AVERAGE</cf>
<format>Average output:@7.2 @sbits/s</format>
</gprint>
<gprint>
<datasource>out8</datasource>
<cf>MAX</cf>
<format>Maximum output:@7.2 @Sbits/s</format>
</gprint>
<gprint>
<datasource>out</datasource>
<cf>TOTAL</cf>
<format>Total output:@7.2 @sbytes@l</format>
<base>1024</base>
</gprint>
<gprint>
<datasource>in8</datasource>
<cf>AVERAGE</cf>
<format>Average input: @7.2 @sbits/s</format>
</gprint>
<gprint>
<datasource>in8</datasource>
<cf>MAX</cf>
<format>Maximum input: @7.2 @Sbits/s</format>
</gprint>
<gprint>
<datasource>in</datasource>
<cf>TOTAL</cf>
<format>Total input :@7.2 @sbytes@l</format>
<base>1024</base>
</gprint>
<comment>@l</comment>
<comment>Description on device: ${alias}@l</comment>
<comment>[${date_start}] -- [${date_end}]</comment>
</graph>
</rrd_graph_def>
71 changes: 71 additions & 0 deletions mrtg/conf/mrtg.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mrtg>
<router>
<host>10.73.250.1</host>
<community>look</community>
<description/>
<active>true</active>
<interface>
<ifIndex>4</ifIndex>
<ifDescr>eth0</ifDescr>
<ifAlias>Internet</ifAlias>
<description/>
<samplingInterval>300</samplingInterval>
<active>true</active>
</interface>
<interface>
<ifIndex>6</ifIndex>
<ifDescr>eth2</ifDescr>
<ifAlias>LAG</ifAlias>
<description/>
<samplingInterval>300</samplingInterval>
<active>true</active>
</interface>
<interface>
<ifIndex>7</ifIndex>
<ifDescr>eth3</ifDescr>
<ifAlias>LAG</ifAlias>
<description/>
<samplingInterval>300</samplingInterval>
<active>true</active>
</interface>
</router>
<router>
<host>10.73.4.208</host>
<community>look</community>
<description>czx</description>
<active>true</active>
<interface>
<ifIndex>1</ifIndex>
<ifDescr>port 1: Gigabit Copper</ifDescr>
<ifAlias/>
<description>sd</description>
<samplingInterval>300</samplingInterval>
<active>true</active>
</interface>
<interface>
<ifIndex>2</ifIndex>
<ifDescr>port 2: Gigabit Copper</ifDescr>
<ifAlias/>
<description>sd</description>
<samplingInterval>300</samplingInterval>
<active>true</active>
</interface>
<interface>
<ifIndex>4</ifIndex>
<ifDescr>port 4: Gigabit Copper</ifDescr>
<ifAlias/>
<description/>
<samplingInterval>300</samplingInterval>
<active>true</active>
</interface>
<interface>
<ifIndex>8</ifIndex>
<ifDescr>port 8: Gigabit Copper</ifDescr>
<ifAlias>Zero</ifAlias>
<description/>
<samplingInterval>300</samplingInterval>
<active>true</active>
</interface>
</router>
</mrtg>
90 changes: 90 additions & 0 deletions mrtg/conf/rrd_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<rrd_def>
<path>${path}</path>
<step>300</step>
<datasource>
<name>in</name>
<type>COUNTER</type>
<heartbeat>6000</heartbeat>
<min>U</min>
<max>U</max>
</datasource>
<datasource>
<name>out</name>
<type>COUNTER</type>
<heartbeat>6000</heartbeat>
<min>U</min>
<max>U</max>
</datasource>
<archive>
<cf>AVERAGE</cf>
<xff>0.5</xff>
<steps>1</steps>
<rows>600</rows>
</archive>
<archive>
<cf>AVERAGE</cf>
<xff>0.5</xff>
<steps>6</steps>
<rows>700</rows>
</archive>
<archive>
<cf>AVERAGE</cf>
<xff>0.5</xff>
<steps>24</steps>
<rows>775</rows>
</archive>
<archive>
<cf>AVERAGE</cf>
<xff>0.5</xff>
<steps>288</steps>
<rows>797</rows>
</archive>
<archive>
<cf>MAX</cf>
<xff>0.5</xff>
<steps>1</steps>
<rows>600</rows>
</archive>
<archive>
<cf>MAX</cf>
<xff>0.5</xff>
<steps>6</steps>
<rows>700</rows>
</archive>
<archive>
<cf>MAX</cf>
<xff>0.5</xff>
<steps>24</steps>
<rows>775</rows>
</archive>
<archive>
<cf>MAX</cf>
<xff>0.5</xff>
<steps>288</steps>
<rows>797</rows>
</archive>
<archive>
<cf>MIN</cf>
<xff>0.5</xff>
<steps>1</steps>
<rows>600</rows>
</archive>
<archive>
<cf>MIN</cf>
<xff>0.5</xff>
<steps>6</steps>
<rows>700</rows>
</archive>
<archive>
<cf>MIN</cf>
<xff>0.5</xff>
<steps>24</steps>
<rows>775</rows>
</archive>
<archive>
<cf>MIN</cf>
<xff>0.5</xff>
<steps>288</steps>
<rows>797</rows>
</archive>
</rrd_def>
Binary file added mrtg/rrd/[email protected]
Binary file not shown.
Binary file added mrtg/rrd/[email protected]
Binary file not shown.
Binary file added mrtg/rrd/[email protected]
Binary file not shown.
Binary file added mrtg/rrd/[email protected]
Binary file not shown.
Binary file added mrtg/rrd/[email protected]
Binary file not shown.
Binary file added mrtg/rrd/[email protected]
Binary file not shown.
Binary file added mrtg/rrd/[email protected]
Binary file not shown.
15 changes: 12 additions & 3 deletions nbactions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath my.harp07.PjFrame</exec.args>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.executable>java</exec.executable>
<exec.mainClass>my.harp07.PjFrame</exec.mainClass>
<exec.vmArgs></exec.vmArgs>
<exec.appArgs></exec.appArgs>
</properties>
</action>
<action>
Expand All @@ -24,9 +27,12 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath ${packageClassName}</exec.args>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
<exec.mainClass>my.harp07.PjFrame</exec.mainClass>
<exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs>
<exec.appArgs></exec.appArgs>
</properties>
</action>
<action>
Expand All @@ -39,8 +45,11 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath ${packageClassName}</exec.args>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.executable>java</exec.executable>
<exec.mainClass>my.harp07.PjFrame</exec.mainClass>
<exec.vmArgs></exec.vmArgs>
<exec.appArgs></exec.appArgs>
</properties>
</action>
</actions>
Loading

0 comments on commit da3deb5

Please sign in to comment.