Git Product home page Git Product logo

mrtg's Introduction

mrtg

Gitter full-check

What is MRTG ?

The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network links. MRTG generates HTML pages containing PNG images which provide a LIVE visual representation of this traffic.
extract from mrtg.pod

Go to http://oss.oetiker.ch/mrtg for all the details about mrtg.

Latest MRTG release -> 2.17.10

For installing on LINUX/UNIX, follow the instructions in

doc/mrtg-unix-guide.txt

If you want to setup MRTG on WINDOWS NT, read

doc/mrtg-nt-guide.txt

mrtg's People

Contributors

ankcn avatar cheese1 avatar eribertomota avatar fweimer-rh avatar gitter-badger avatar gpancot avatar gregvolk avatar kiplandwehr avatar leoreginin avatar lukerg avatar moxsh avatar nistorj avatar oetiker avatar renatocfrancisco avatar therealbstern avatar vcrhonek avatar youpong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mrtg's Issues

MRTG Graphs are not updating

Hello All,

Currently we are getting wrong values for some of the routers configured in MRTG. Can anyone please let me know what are the preliminary and troubleshooting steps to be taken to correct the values.

Thanks,
Ravitheja.

SNMPv3 does not pull correct counters with multiple contexts on the same node

This functionality below actually prevents SNMPv3 multiple contexts working correctly when retrieving the same OID

%<--------------------------------
SNMP Request Optimization
MRTG is designed to economize on its SNMP requests. Where a target definition appears more than once in the configuration file, MRTG requests the data from the device only once per round of data collection and uses the collected data for each instance of a particular target. Recognition of two target definitions as being identical is based on a simple string match rather than any kind of deeper semantic analysis.
%<--------------------------------

What happens is that target line is actually identical (OID+IP) but what makes the difference is the context name in SnmpOptions. As a result all contexts will get the same value assigned for the same OID retrieved from the first poll.
Workaround seems to be to change host name with mix of different lower and upper case letters for different contexts but would be nice to have a proper fix!

Thanks

Warning: format ‘%x’ expects argument of type ‘unsigned int *’

Description

The following warnings are shown when building mrtg.

gcc  -Wpedantic -Wall -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline -W -DHAVE_CONFIG_H -c ./src/rateup.c -o bin/rateup.o
./src/rateup.c: In function ‘main’:
./src/rateup.c:2169:39: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘int *’ [-Wformat=]
 2169 |           sscanf (argv[argi + 1], "#%2x%2x%2x", &col_in[0], &col_in[1],
      |                                     ~~^         ~~~~~~~~~~
      |                                       |         |
      |                                       |         int *
      |                                       unsigned int *
      |                                     %2x

How to reproduce

  1. $ ./configure CFLAGS=-Wpedantic
  2. $ make

MRTG always ends with ERROR

Dear @oetiker,

After a 'kill ' MRTG ends with ERROR. From the log:

2021-10-27 14:14:56 -- 2021-10-27 14:10:11: ERROR: Bailout after SIG TERM

From systemctl status (Debian Sid, MRTG 2.17.8+git20211022.f52e91e):

out 27 14:14:56 debian-sid systemd[1]: mrtg.service: Main process exited, code=exited, status=1/FAILURE
out 27 14:14:56 debian-sid systemd[1]: mrtg.service: Failed with result 'exit-code'.

This behavior is a bit odd, because kill command is sending SIG TERM. Any program must graceful stop after a SIG TERM.

Thanks for your attention and nice work.

Regards,

Eriberto

Version 2.17.9 is not installable

Hi @oetiker

Thanks for release the 2.17.9 version. However, this version is not installable because the file doc/mrtglib.3 does not exist (but there is the old, no longer needed, mrtglib.1). See below:

# make install
[...]
for x in ./doc/*.3; do \
  /usr/bin/install -c -m 644 $x /opt/mrtg-2/share/man/man3; done
/usr/bin/install: cannot stat './doc/*.3': No such file or directory
make: *** [Makefile:70: install] Error 1

As a workaround, I ran make doc before make install.

Cheers,

Eriberto

Sometimes, MRTG forget to translate the second line

Hi @oetiker,

Mainly when restarting the service (via systemd) in Debian, MRTG doesn't translate the second line. See below an example for Brazilian Portuguese:

Trafego de rede na br-kvm
The statistics were last updated Terça, 26 de Saíubro de 2021 às 2:17
Gráfico `Diário' (5 minutos Média)

Note that word "Saíubro" doesn't exist in Portuguese and isn't present in source code. The right word is "Outubro". After 5 minutes, I got the same result:

Trafego de rede na br-kvm
The statistics were last updated Terça, 26 de Saíubro de 2021 às 2:22
Gráfico `Diário' (5 minutos - média)

After 15 minutes, the line was translated:

Trafego de rede na br-kvm
Última atualização das estatísticas: Terça, 26 de Outubro de 2021 às 2:37
Gráfico `Diário' (5 minutos Média)

Thanks in advance.

Regards,

Eriberto

RouterUpTime does not honour/use colon options

While the documentation does not state that the RouterUptime[] parameter accepts colon options (for version and port number), I would like it to do just that.
The exact use case in my instance is interacting with vendor Cisco's Meraki cloud.
It is also a tad non obvious, since colon options are accepted elsewhere in the configuration files.

Warning: implicit declaration of function ‘strncasecmp’

Description

The following warnings are shown when building mrtg.

gcc  -std=c18 -Wall -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline -W -DHAVE_CONFIG_H -c ./src/rateup.c -o bin/rateup.o
./src/rateup.c: In function ‘main’:
./src/rateup.c:1838:22: warning: implicit declaration of function ‘strncasecmp’; did you mean ‘strncmp’? [-Wimplicit-function-declaration]
 1838 |   if ((argc > 1) && (strncasecmp (argv[1], "-F", 2) == 0))
      |                      ^~~~~~~~~~~
      |                      strncmp
./src/rateup.c:1838:22: warning: nested extern declaration of ‘strncasecmp’ [-Wnested-externs]

How to reproduce

  1. $ ./configure CFLAGS=-std=c18
  2. $ make

cfgmaker error with snmpv3

I get the following output from cfgmaker:

--base: SNMP V3 libraries found, SNMP V3 enabled.
--base: Get Device Info on public@hostname:::::3
usage: $sock->socket(DOMAIN, TYPE, PROTOCOL) at /usr/share/perl5/Net/SNMP/Transport/IPv4.pm line 36.

Using this command:

cfgmaker --contextengineid=xxxxxx --snmp-options=:::::3 --enablesnmpv3 --username=xxx --authpassword='xxx' --privpassword='xxx' hostname > /etc/mrtg.cfg

Versions:

cfgmaker --version
cfgmaker for mrtg-2.17.10

perl -v
This is perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-linux-gnu-thread-multi
(with 50 registered patches, see perl -V for more detail)

Using Ubuntu 22.04, but replicated with Ubuntu 20.04

Problems and doubts with executing MRTG.cfg

Following the "nt-windows-guide"....
I downloaded the mrtg zip file for windows. I extracted,
I put in a folder on (C:) and inside i created a folder "www" for the graphs.
"perl mrtg" confirmed; i create the mrtg.cfg using "perl cfgmaker public@localhost --global "WorkDir: C:\mrtg-2.17.7\www" --output mrtg.cfg"

I wrote "RunAsDaemon: yes" in the first line of the generated file and then i hit "perl mrtg mrtg.cfg" Below is a .txt with results from the first time executing.
perl mrtg mrtg.cfg first time.txt
I close the command prompt and i try it again "perl mrtg mrtg.cfg" and now the results are:
perl mrtg mrtg.cfg second time.txt

mrtg file line 372 is exec @STARTARGS;
What is happening with line 372?
Is there a problem for putting "localhost" on "perl cfgmaker ..."?
for me, it doesn't work.

cfgmaker shows opr / admin down interfaces on Arista

Hi All,

I recently upgraded to mrtg-2.17.8 on OpenBSD and for some reason it's no longer ignoring interfaces which are opr / admin DOWN. This is only happening with the Arista 7050QX-32S not with 7050T-64 or 7048T.
Anybody any ideas why this is happening? The cfgmaker options are identical, except name of course.

cfgmaker --global "WorkDir: /var/www/rrdtool"   \
        --global "Options[_]: growright,bits"   \
        --global "Directory[_]: dcs1d10.dc1"    \
        --ifref=descr                           \
        --ifdesc=alias                          \
        <community>@<host>            \
        > ../dcs1d10.dc1.cfg
indexmaker --sort=title --output=/var/www/rrdtool/dcs1d10.dc1.html /home/mischa/mrtg/dcs1d10.dc1.cfg

Support for NULL records in log/graph when timeouts occur

MRTG only permits timeouts to be logged as 0 or the previous value. Such entries should be treated as NULL (undef), so that there is no need to choose between two different ways of deliberately recording wrong data. The graph then ought to use something like an orange background for each column of pixels where there is no data at all, so that there is no confusion as to whether there is or is not any valid data.

Within the log, a value of “-” should be a simple-enough way to indicate that no data was returned at all.

cfgmaker confuses Cisco code versions on Nexus

We ran into an interesting issue tonight that I believe has to do with roughly this code section:

// cfgmaker lines ~176

    if ($routers->{$router}{deviceinfo}{Vendor} eq 'cisco' &&
        $routers->{$router}{deviceinfo}{sysDescr} =~ m/Version\s+(\d+\.\d+)/) {
        push @Variables,  ($1 > 11.0 or $1 < 10.0 ) ? "ifAlias" : "CiscolocIfDescr";
        print "DEBUG VERSION ===> $1 \n";
        if ($1 > 11.2) {push @Variables, "vmVlan";};
       if ($1 > 11.3) {push @Variables, "vlanTrunkPortDynamicStatus";};
    } elsif ( $routers->{$router}{deviceinfo}{Vendor} =~ /(?:hp|juniper|dlink|wwp|foundry|dellLan|force10|3com|extremenetworks|openBSD|arist
a|enterasys|zyxel|vyatta)/i) {
        push @Variables, "ifAlias";
    }

When I added the DEBUG line in there the output of my version is 10.2, as per my NXOS version:

RFC1213-MIB::sysDescr.0 = STRING: "Cisco NX-OS(tm) Nexus9000 C9364C, Software (NXOS 64-bit), Version 10.2(1), RELEASE SOFTWARE Copyright (c) 2002-2021 by Cisco Systems, Inc. Compiled 8/23/2021 17:00:00"

It seems to think the answer should be CiscolocIfDescr when in fact it needs to be ifAlias.

To validate this we simply changed the version accordingly and it had solved our issue.

We narrowed this down in our testing using custom templates outputting all the info and noticed that ifAlias and cisco_descr were both empty.

noHC=yes incorrectly inserted by cfgmaker

noHC=yes is inserted by cfgmaker not only when HC counters are unavailable, but also when interface has not yet seen any incoming traffic (ifHCInOctets=0).

Thus every unused interface initially gets noHC=yes, causing it to show bogus graphs when traffic starts to flow. After next cfgmaker run, it switches to HC counters, making huge spike in the graph.

ERROR: CFG Error in "workdir"

ERROR: CFG Error in "workdir", file mrtg.cfg line 20: Working directory c:\www\mrtg does not exist

On the mrtg.cfg, i put 127.0.0.1 as my IP Address
and on the line 20 there is "Enable IPv6: no"

Is this normal? What am i doing wrong?

Bind mrtg to 127.0.0.1 for security reasons

mrtg opens a udp port on all interfaces, this is security concern:
service mrtg_daemon onestart
sockstat -46L | grep mrtg
mrtg perl 634 4 udp4 *:36768 :

Is it possible to bind mrtg to 127.0.0.1 , for security reasons ?

rateup crashes when kMG is set

With 2.17.4, I can reproduce a crash (SIGABRT from 'pointer being freed was not allocated') on Mac OS X 10.12.

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called
*** error for object 0x7f8899d001d0: pointer being freed was not allocated


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib              0x00007fff90ef9dda __pthread_kill + 10
1   libsystem_pthread.dylib             0x00007fff90fe4797 pthread_kill + 90
2   libsystem_c.dylib                   0x00007fff90e5f440 abort + 129
3   libsystem_malloc.dylib              0x00007fff90f4f097 free + 530
4   rateup                              0x0000000105a1ee2d image + 13457
5   rateup                              0x0000000105a1b5f0 main + 4908
6   libdyld.dylib                       0x00007fff90dcb255 start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000006  rcx: 0x00007fff5a1e4a08  rdx: 0x0000000000000000
  rdi: 0x000000000000060b  rsi: 0x0000000000000006  rbp: 0x00007fff5a1e4a30  rsp: 0x00007fff5a1e4a08
   r8: 0x0000000000000000   r9: 0x0000000000000000  r10: 0x0000000008000000  r11: 0x0000000000000206
  r12: 0x00007f889a823800  r13: 0x0000000000000001  r14: 0x00007fff99ace3c0  r15: 0x0000000000000000
  rip: 0x00007fff90ef9dda  rfl: 0x0000000000000206  cr2: 0x00007fff90fe249b

Logical CPU:     0
Error Code:      0x02000148
Trap Number:     133

Warnings with GCC 11

Dear @oetiker,

The following warnings are shown when building mrtg over GCC 11. Feel free to close this issue if not important for you to fix these warnings. Thanks!

Eriberto

gcc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/PKGS/mrtg2/mrtg=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline -W -DHAVE_CONFIG_H -c ./src/rateup.c -o bin/rateup.o
/usr/bin/perl -0777 -p -i~ -e "s'^#!\s*/\S*perl'#! /usr/bin/perl'" ./bin/cfgmaker ./bin/indexmaker ./bin/mrtg
/usr/bin/perl -0777 -p -i~ -e 's@GRAPHFMT="...";@GRAPHFMT="png";@' ./bin/mrtg ./bin/indexmaker
./src/rateup.c: In function ‘image’:
./src/rateup.c:330:7: warning: variable ‘i_outp’ set but not used [-Wunused-but-set-variable]
  330 |   int i_outp, i_outpg;
      |       ^~~~~~
./src/rateup.c:329:70: warning: variable ‘i_outm’ set but not used [-Wunused-but-set-variable]
  329 |   int i_light, i_dark, i_blank, i_major, i_in, i_out, i_grid, i_inm, i_outm;
      |                                                                      ^~~~~~
./src/rateup.c:329:48: warning: variable ‘i_out’ set but not used [-Wunused-but-set-variable]
  329 |   int i_light, i_dark, i_blank, i_major, i_in, i_out, i_grid, i_inm, i_outm;
      |                                                ^~~~~
./src/rateup.c: In function ‘update’:
./src/rateup.c:1459:43: warning: left shift of negative value [-Wshift-negative-value]
 1459 |                 if (inr > - (long long) 1 << 32) {      /* wrapped 32-bit counter? */
      |                                           ^~
./src/rateup.c:1506:44: warning: left shift of negative value [-Wshift-negative-value]
 1506 |                 if (outr > - (long long) 1 << 32) {
      |                                            ^~
./src/rateup.c:239:15: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘long unsigned int’ [-Wsign-compare]
  239 |       if (avc != steptime) {\
      |               ^~
./src/rateup.c:1596:11: note: in expansion of macro ‘NEXT’
 1596 |           NEXT ((unsigned long) (now - plannow));
      |           ^~~~
./src/rateup.c:239:15: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘long unsigned int’ [-Wsign-compare]
  239 |       if (avc != steptime) {\
      |               ^~
./src/rateup.c:1633:11: note: in expansion of macro ‘NEXT’
 1633 |           NEXT ((unsigned long) (now - plannow));
      |           ^~~~
./src/rateup.c:239:15: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘long unsigned int’ [-Wsign-compare]
  239 |       if (avc != steptime) {\
      |               ^~
./src/rateup.c:1670:11: note: in expansion of macro ‘NEXT’
 1670 |           NEXT ((unsigned long) (now - plannow));
      |           ^~~~
./src/rateup.c:239:15: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘long unsigned int’ [-Wsign-compare]
  239 |       if (avc != steptime) {\
      |               ^~
./src/rateup.c:1707:11: note: in expansion of macro ‘NEXT’
 1707 |           NEXT ((unsigned long) (now - plannow));
      |           ^~~~
./src/rateup.c: In function ‘readhist’:
./src/rateup.c:1256:11: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1256 |           fgets (buf, 256, fi);
      |           ^~~~~~~~~~~~~~~~~~~~

mrtg installing its own Pod module in public space?

mrtg installs its own Pod module from lib/mrtg2/Pod in global filespace, which on pkgsrc creates conflicts with packages that depend on an external Pod pkg.

Is there a clean way (short of patching the Makefile.in) to disable the internal Pod, and point the mrtg build to an external dependency?

MRTG reference page structure malformed

https://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html has some odd problems (and has done for years).

The <title> element is completely borked.

Most if not all the headings are missing their id properties, so the table of contents links do not go anywhere.

The page begins with a huge block of giant grey boxes (NAME, OVERVIEW, SYNTAX etc), none of which actually does anything.

Also the page now ends:

Hey! The above document had some coding errors, which are explained below:

Around line 547:

'=item' outside of any '=over'

How to get remotly information

I'm trying to setup a client mrtg to fetch several servers informations. I don't want to install a web server on the remote server. Is there some official doc to retreive server information remotly ?

I tried to change the file (/etc/snmp/snmpd.conf) :

com2sec local      localhost        mycon
com2sec mynetwork  50.11.191.110/24 mycon

Here is a representive architecture of what I expect to do :

Schema

But it end up with an error. I'm using CentOS 7 as the operating system. Thank you for any suggestion

EDIT :

I also have installed snmp on the client machine.

I tried to configure the file on the remote server (/etc/snmp/snmpd.conf) :

###############################################################################
#
# snmpd.conf:
#   An example configuration file for configuring the ucd-snmp snmpd agent.
#
###############################################################################
#
# This file is intended to only be as a starting point.  Many more
# configuration directives exist than are mentioned in this file.  For
# full details, see the snmpd.conf(5) manual page.
#
# All lines beginning with a '#' are comments and are intended for you
# to read.  All other lines are configuration commands for the agent.

###############################################################################
# Access Control
###############################################################################

# As shipped, the snmpd demon will only respond to queries on the
# system mib group until this file is replaced or modified for
# security purposes.  Examples are shown below about how to increase the
# level of access.

# By far, the most common question I get about the agent is "why won't
# it work?", when really it should be "how do I configure the agent to
# allow me to access it?"
#
# By default, the agent responds to the "public" community for read
# only access, if run out of the box without any configuration file in
# place.  The following examples show you other ways of configuring
# the agent so that you can change the community names, and give
# yourself write access to the mib tree as well.
#
# For more information, read the FAQ as well as the snmpd.conf(5)
# manual page.

####
# First, map the community name "public" into a "security name"

#       sec.name  source          community
#com2sec notConfigUser   default       public

####
# Second, map the security name into a group name:

    
#       groupName      securityModel securityName
group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser

####
# Third, create a view for us to let the group have rights to:

# Make at least  snmpwalk -v 1 localhost -c public system fast again.
#       name           incl/excl     subtree         mask(optional)
#view    systemview    included   .1.3.6.1.2.1.1
#view    systemview    included   .1.3.6.1.2.1.25.1.1

view    systemview    included   .1.3.6.1.2.1
view    systemview    included   .1.3.6.1.2.1.25.1



####
# Finally, grant the group read-only access to the systemview view.

#       group          context sec.model sec.level prefix read   write  notif
access  notConfigGroup ""      any       noauth    exact  systemview none none

# -----------------------------------------------------------------------------

# Here is a commented out example configuration that allows less
# restrictive access.

# YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY
# KNOWN AT YOUR SITE.  YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO
# SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE.

##       sec.name  source          community
com2sec local      localhost        mycom
com2sec mynetwork  51.15.10.111/32  mycom

##     group.name sec.model  sec.name
group  MyRWGroup    v2c       local
group  MyROGroup    v2c       mynetwork
#
#group MyRWGroup  any        otherv3user
#...

##           incl/excl subtree                          mask
view all    included  .1                               80

## -or just the mib2 tree-

#view mib2   included  .iso.org.dod.internet.mgmt.mib-2 fc


##                context sec.model sec.level prefix read   write  notif
access MyROGroup "" any   noauth   exact   all   none     none
access MyRWGroup "" v2c   noauth   exact   all   all      all


###############################################################################
# Sample configuration to make net-snmpd RFC 1213.
# Unfortunately v1 and v2c don't allow any user based authentification, so
# opening up the default config is not an option from a security point.
#
# WARNING: If you uncomment the following lines you allow write access to your
# snmpd daemon from any source! To avoid this use different names for your
# community or split out the write access to a different community and
# restrict it to your local network.
# Also remember to comment the syslocation and syscontact parameters later as
# otherwise they are still read only (see FAQ for net-snmp).
#

# First, map the community name "public" into a "security name"
#       sec.name        source          community
#com2sec notConfigUser   default         public

# Second, map the security name into a group name:
#       groupName       securityModel   securityName
#group   notConfigGroup  v1              notConfigUser
#group   notConfigGroup  v2c             notConfigUser

# Third, create a view for us to let the group have rights to:
# Open up the whole tree for ro, make the RFC 1213 required ones rw.
#       name            incl/excl       subtree mask(optional)
#view    roview          included        .1
#view    rwview          included        system.sysContact
#view    rwview          included        system.sysName
#view    rwview          included        system.sysLocation
#view    rwview          included        interfaces.ifTable.ifEntry.ifAdminStatus
#view    rwview          included        at.atTable.atEntry.atPhysAddress
#view    rwview          included        at.atTable.atEntry.atNetAddress
#view    rwview          included        ip.ipForwarding
#view    rwview          included        ip.ipDefaultTTL
#view    rwview          included        ip.ipRouteTable.ipRouteEntry.ipRouteDest
#view    rwview          included        ip.ipRouteTable.ipRouteEntry.ipRouteIfIndex
#view    rwview          included        ip.ipRouteTable.ipRouteEntry.ipRouteMetric1
#view    rwview          included        ip.ipRouteTable.ipRouteEntry.ipRouteMetric2
#view    rwview          included        ip.ipRouteTable.ipRouteEntry.ipRouteMetric3
#view    rwview          included        ip.ipRouteTable.ipRouteEntry.ipRouteMetric4
#view    rwview          included        ip.ipRouteTable.ipRouteEntry.ipRouteType
#view    rwview          included        ip.ipRouteTable.ipRouteEntry.ipRouteAge
#view    rwview          included        ip.ipRouteTable.ipRouteEntry.ipRouteMask
#view    rwview          included        ip.ipRouteTable.ipRouteEntry.ipRouteMetric5
#view    rwview          included        ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaIfIndex
#view    rwview          included        ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaPhysAddress
#view    rwview          included        ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaNetAddress
#view    rwview          included        ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType
#view    rwview          included        tcp.tcpConnTable.tcpConnEntry.tcpConnState
#view    rwview          included        egp.egpNeighTable.egpNeighEntry.egpNeighEventTrigger
#view    rwview          included        snmp.snmpEnableAuthenTraps

# Finally, grant the group read-only access to the systemview view.
#       group          context sec.model sec.level prefix read   write  notif
#access  notConfigGroup ""      any       noauth    exact  roview rwview none



###############################################################################
# System contact information
#

# It is also possible to set the sysContact and sysLocation system
# variables through the snmpd.conf file:

syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)

# Example output of snmpwalk:
#   % snmpwalk -v 1 localhost -c public system
#   system.sysDescr.0 = "SunOS name sun4c"
#   system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4
#   system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55
#   system.sysContact.0 = "Me <[email protected]>"
#   system.sysName.0 = "name"
#   system.sysLocation.0 = "Right here, right now."
#   system.sysServices.0 = 72


###############################################################################
# Logging
#

# We do not want annoying "Connection from UDP: " messages in syslog.
# If the following option is commented out, snmpd will print each incoming
# connection, which can be useful for debugging.

dontLogTCPWrappersConnects yes

# -----------------------------------------------------------------------------


###############################################################################
# Process checks.
#
#  The following are examples of how to use the agent to check for
#  processes running on the host.  The syntax looks something like:
#
#  proc NAME [MAX=0] [MIN=0]
#
#  NAME:  the name of the process to check for.  It must match
#         exactly (ie, http will not find httpd processes).
#  MAX:   the maximum number allowed to be running.  Defaults to 0.
#  MIN:   the minimum number to be running.  Defaults to 0.

#
#  Examples (commented out by default):
#

#  Make sure mountd is running
#proc mountd

#  Make sure there are no more than 4 ntalkds running, but 0 is ok too.
#proc ntalkd 4

#  Make sure at least one sendmail, but less than or equal to 10 are running.
#proc sendmail 10 1

#  A snmpwalk of the process mib tree would look something like this:
#
# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.2
# enterprises.ucdavis.procTable.prEntry.prIndex.1 = 1
# enterprises.ucdavis.procTable.prEntry.prIndex.2 = 2
# enterprises.ucdavis.procTable.prEntry.prIndex.3 = 3
# enterprises.ucdavis.procTable.prEntry.prNames.1 = "mountd"
# enterprises.ucdavis.procTable.prEntry.prNames.2 = "ntalkd"
# enterprises.ucdavis.procTable.prEntry.prNames.3 = "sendmail"
# enterprises.ucdavis.procTable.prEntry.prMin.1 = 0
# enterprises.ucdavis.procTable.prEntry.prMin.2 = 0
# enterprises.ucdavis.procTable.prEntry.prMin.3 = 1
# enterprises.ucdavis.procTable.prEntry.prMax.1 = 0
# enterprises.ucdavis.procTable.prEntry.prMax.2 = 4
# enterprises.ucdavis.procTable.prEntry.prMax.3 = 10
# enterprises.ucdavis.procTable.prEntry.prCount.1 = 0
# enterprises.ucdavis.procTable.prEntry.prCount.2 = 0
# enterprises.ucdavis.procTable.prEntry.prCount.3 = 1
# enterprises.ucdavis.procTable.prEntry.prErrorFlag.1 = 1
# enterprises.ucdavis.procTable.prEntry.prErrorFlag.2 = 0
# enterprises.ucdavis.procTable.prEntry.prErrorFlag.3 = 0
# enterprises.ucdavis.procTable.prEntry.prErrMessage.1 = "No mountd process running."
# enterprises.ucdavis.procTable.prEntry.prErrMessage.2 = ""
# enterprises.ucdavis.procTable.prEntry.prErrMessage.3 = ""
# enterprises.ucdavis.procTable.prEntry.prErrFix.1 = 0
# enterprises.ucdavis.procTable.prEntry.prErrFix.2 = 0
# enterprises.ucdavis.procTable.prEntry.prErrFix.3 = 0
#
#  Note that the errorFlag for mountd is set to 1 because one is not
#  running (in this case an rpc.mountd is, but thats not good enough),
#  and the ErrMessage tells you what's wrong.  The configuration
#  imposed in the snmpd.conf file is also shown.
#
#  Special Case:  When the min and max numbers are both 0, it assumes
#  you want a max of infinity and a min of 1.
#


# -----------------------------------------------------------------------------


###############################################################################
# Executables/scripts
#

#
#  You can also have programs run by the agent that return a single
#  line of output and an exit code.  Here are two examples.
#
#  exec NAME PROGRAM [ARGS ...]
#
#  NAME:     A generic name. The name must be unique for each exec statement.
#  PROGRAM:  The program to run.  Include the path!
#  ARGS:     optional arguments to be passed to the program

# a simple hello world

#exec echotest /bin/echo hello world

# Run a shell script containing:
#
# #!/bin/sh
# echo hello world
# echo hi there
# exit 35
#
# Note:  this has been specifically commented out to prevent
# accidental security holes due to someone else on your system writing
# a /tmp/shtest before you do.  Uncomment to use it.
#
#exec shelltest /bin/sh /tmp/shtest

# Then,
# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.8
# enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1
# enterprises.ucdavis.extTable.extEntry.extIndex.2 = 2
# enterprises.ucdavis.extTable.extEntry.extNames.1 = "echotest"
# enterprises.ucdavis.extTable.extEntry.extNames.2 = "shelltest"
# enterprises.ucdavis.extTable.extEntry.extCommand.1 = "/bin/echo hello world"
# enterprises.ucdavis.extTable.extEntry.extCommand.2 = "/bin/sh /tmp/shtest"
# enterprises.ucdavis.extTable.extEntry.extResult.1 = 0
# enterprises.ucdavis.extTable.extEntry.extResult.2 = 35
# enterprises.ucdavis.extTable.extEntry.extOutput.1 = "hello world."
# enterprises.ucdavis.extTable.extEntry.extOutput.2 = "hello world."
# enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0
# enterprises.ucdavis.extTable.extEntry.extErrFix.2 = 0

# Note that the second line of the /tmp/shtest shell script is cut
# off.  Also note that the exit status of 35 was returned.

# -----------------------------------------------------------------------------


###############################################################################
# disk checks
#

# The agent can check the amount of available disk space, and make
# sure it is above a set limit.

# disk PATH [MIN=100000]
#
# PATH:  mount path to the disk in question.
# MIN:   Disks with space below this value will have the Mib's errorFlag set.
#        Default value = 100000.

# Check the / partition and make sure it contains at least 10 megs.

#disk / 10000

# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.9
# enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0
# enterprises.ucdavis.diskTable.dskEntry.diskPath.1 = "/" Hex: 2F
# enterprises.ucdavis.diskTable.dskEntry.diskDevice.1 = "/dev/dsk/c201d6s0"
# enterprises.ucdavis.diskTable.dskEntry.diskMinimum.1 = 10000
# enterprises.ucdavis.diskTable.dskEntry.diskTotal.1 = 837130
# enterprises.ucdavis.diskTable.dskEntry.diskAvail.1 = 316325
# enterprises.ucdavis.diskTable.dskEntry.diskUsed.1 = 437092
# enterprises.ucdavis.diskTable.dskEntry.diskPercent.1 = 58
# enterprises.ucdavis.diskTable.dskEntry.diskErrorFlag.1 = 0
# enterprises.ucdavis.diskTable.dskEntry.diskErrorMsg.1 = ""

# -----------------------------------------------------------------------------


###############################################################################
# load average checks
#

# load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0]
#
# 1MAX:   If the 1 minute load average is above this limit at query
#         time, the errorFlag will be set.
# 5MAX:   Similar, but for 5 min average.
# 15MAX:  Similar, but for 15 min average.

# Check for loads:
#load 12 14 14

# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.10
# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1
# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.2 = 2
# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.3 = 3
# enterprises.ucdavis.loadTable.laEntry.loadaveNames.1 = "Load-1"
# enterprises.ucdavis.loadTable.laEntry.loadaveNames.2 = "Load-5"
# enterprises.ucdavis.loadTable.laEntry.loadaveNames.3 = "Load-15"
# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.1 = "0.49" Hex: 30 2E 34 39
# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.2 = "0.31" Hex: 30 2E 33 31
# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.3 = "0.26" Hex: 30 2E 32 36
# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.1 = "12.00"
# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.2 = "14.00"
# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.3 = "14.00"
# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.1 = 0
# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.2 = 0
# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.3 = 0
# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.1 = ""
# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.2 = ""
# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.3 = ""

# -----------------------------------------------------------------------------


###############################################################################
# Extensible sections.
#

# This alleviates the multiple line output problem found in the
# previous executable mib by placing each mib in its own mib table:

# Run a shell script containing:
#
# #!/bin/sh
# echo hello world
# echo hi there
# exit 35
#
# Note:  this has been specifically commented out to prevent
# accidental security holes due to someone else on your system writing
# a /tmp/shtest before you do.  Uncomment to use it.
#
# exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest

# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.50
# enterprises.ucdavis.50.1.1 = 1
# enterprises.ucdavis.50.2.1 = "shelltest"
# enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest"
# enterprises.ucdavis.50.100.1 = 35
# enterprises.ucdavis.50.101.1 = "hello world."
# enterprises.ucdavis.50.101.2 = "hi there."
# enterprises.ucdavis.50.102.1 = 0

# Now the Output has grown to two lines, and we can see the 'hi
# there.' output as the second line from our shell script.
#
# Note that you must alter the mib.txt file to be correct if you want
# the .50.* outputs above to change to reasonable text descriptions.

# Other ideas:
#
# exec .1.3.6.1.4.1.2021.51 ps /bin/ps
# exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top
# exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq

# -----------------------------------------------------------------------------


###############################################################################
# Pass through control.
#

# Usage:
#   pass MIBOID EXEC-COMMAND
#
# This will pass total control of the mib underneath the MIBOID
# portion of the mib to the EXEC-COMMAND.
#
# Note:  You'll have to change the path of the passtest script to your
# source directory or install it in the given location.
#
# Example:  (see the script for details)
#           (commented out here since it requires that you place the
#           script in the right location. (its not installed by default))

# pass .1.3.6.1.4.1.2021.255 /bin/sh /usr/local/local/passtest

# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.255
# enterprises.ucdavis.255.1 = "life the universe and everything"
# enterprises.ucdavis.255.2.1 = 42
# enterprises.ucdavis.255.2.2 = OID: 42.42.42
# enterprises.ucdavis.255.3 = Timeticks: (363136200) 42 days, 0:42:42
# enterprises.ucdavis.255.4 = IpAddress: 127.0.0.1
# enterprises.ucdavis.255.5 = 42
# enterprises.ucdavis.255.6 = Gauge: 42
#
# % snmpget -v 1 localhost public .1.3.6.1.4.1.2021.255.5
# enterprises.ucdavis.255.5 = 42
#
# % snmpset -v 1 localhost public .1.3.6.1.4.1.2021.255.1 s "New string"
# enterprises.ucdavis.255.1 = "New string"
#

# For specific usage information, see the man/snmpd.conf.5 manual page
# as well as the local/passtest script used in the above example.

###############################################################################
# Further Information
#
#  See the snmpd.conf manual page, and the output of "snmpd -H".

The main changes :

##  sec.name  source          community
    com2sec local      localhost        mycom
    com2sec mynetwork  51.15.10.111/32  mycom

view    systemview    included   .1.3.6.1.2.1
view    systemview    included   .1.3.6.1.2.1.25.1

##                context sec.model sec.level prefix read   write  notif
access MyROGroup "" any   noauth   exact   all   none     none
access MyRWGroup "" v2c   noauth   exact   all   all      all

File : /etc/sysconfig/snmpd

# snmpd command line options
# '-f' is implicitly added by snmpd systemd unit file
# OPTIONS="-LS0-6d"
OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"

Command: ss -ulnp

UNCONN      0      0       *:161        *:*          
users:(("snmpd",pid=4494,fd=8))

From the client machine I get a timeout

 snmpwalk -v2c -c mycom 51.15.10.111 system

If I run it from the server everything is ok

The polling rate increases after a configuration update.

In my settings, the polling interval is set to three minutes. After some time of work (probably after a regular update of the MRTG configuration file), the frequency of polling targets goes astray. Instead of once every three minutes, the same target is polled twice in the same interval. Later, the polling frequency increases even more, and the frequency of updating RDD files, on the contrary, decreases.

Below is a dump of outgoing SNMP packets. It shows that requests leave 3-4 times more often than required.
09:08:51 IP mrtg-server.44287 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100
09:09:55 IP mrtg-server.38991 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100
09:10:37 IP mrtg-server.46329 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100
09:11:22 IP mrtg-server.42586 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100
09:12:16 IP mrtg-server.60945 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100
09:13:40 IP mrtg-server.58703 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100
09:14:02 IP mrtg-server.56478 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100
09:14:57 IP mrtg-server.58749 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100
The MRTG process here has been restarted and the polling frequency has returned to its normal value of once every three minutes.
09:15:44 IP mrtg-server.55147 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100
09:18:46 IP mrtg-server.57360 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100
09:21:43 IP mrtg-server.56474 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100
09:24:44 IP mrtg-server.52581 > router-1.161: C="public" GetRequest(50) ifHCInOctets.100

RRD file updating (every 9 minutes):
-rw-r--r--. 1 owner owner 122368 Sep 5 08:26 router-1_Fa0.rrd
-rw-r--r--. 1 owner owner 122368 Sep 5 08:35 router-1_Fa0.rrd
-rw-r--r--. 1 owner owner 122368 Sep 5 08:44 router-1_Fa0.rrd
-rw-r--r--. 1 owner owner 122368 Sep 5 08:54 router-1_Fa0.rrd
-rw-r--r--. 1 owner owner 122368 Sep 5 09:03 router-1_Fa0.rrd
-rw-r--r--. 1 owner owner 122368 Sep 5 09:12 router-1_Fa0.rrd
MRTG restart.
-rw-r--r--. 1 owner owner 122368 Sep 5 09:16 router-1_Fa0.rrd
-rw-r--r--. 1 owner owner 122368 Sep 5 09:19 router-1_Fa0.rrd
-rw-r--r--. 1 owner owner 122368 Sep 5 09:22 router-1_Fa0.rrd
-rw-r--r--. 1 owner owner 122368 Sep 5 09:25 router-1_Fa0.rrd
-rw-r--r--. 1 owner owner 122368 Sep 5 09:28 router-1_Fa0.rrd

Configuration file contents (without targets):
EnableIPv6: no
WorkDir: /path
IconDir: /icon-path
Options[]: growright,bits,nolegend,nobanner
RunAsDaemon: Yes
LogFormat: rrdtool
Interval: 3
NoDetach: Yes
YSize[
]: 222
SnmpOptions: retries => 5, timeout => 3
Forks: 9
WithPeak[_]: y

A way to ignore hosts that are unreachable

This is a bug from Debian. Thanks.

Debian Bug #97352
mrtg: a way to ignore hosts that are unreachable.

Reported by: Sami Haahtinen [email protected]
Date: Sun, 13 May 2001 18:48:17 UTC
Severity: wishlist
Found in version 2.9.10-1

it would be nice to have a feature to ignore hosts that are down, at the moment (atleast hosts that need to be walked) give out a warning and appear as void in the graphs. and as the graph is drawn from the void data it appears that the host had for example the same load while it was down. which is not true.

This might be good for hosts that aren't in the same network, but it's not a good thing for hosts that tend to be down now and then.

the right way to deal with this would be to dump 0 as the value when a host is down.

Strange failure with mrtg-2.17.4 and rrdtool >1.4.8

I have encountered a peculiar problem with mrtg and recent versions of rrdtool on a Gentoo Linux system.

Background: I have two (and as far as I'm aware only two) applications that use rrdtool, mrtg and my own upswatch, a tool which uses rrdtool to monitor and graph UPS operating parameters via apcupsd.

If I allow rrdtool to update past release 1.4.8, mrtg still gathers traffic data, but fails to graph it, dying with the following error logged by Apache:

[Sun Mar 18 14:04:39.866602 2018] [cgi:error] [pid 19784:tid 140158795384576] [client 10.24.32.10:50654] AH01215: Undefined subroutine &RRDs::graph called at /var/www/mrtg/mrtg-rrd.cgi line 451.: /var/www/mrtg/mrtg-rrd.cgi, referer: https://www.caerllewys.net/mrtg2/

Yet upswatch continues to work perfectly all the way up to rrdtool-1.7.0. This implies the problem is in mrtg, not in rrdtool. But if the problem is in mrtg, then why does it depend on the rrdtool version?

Problems with timeout documentation

In https://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html under SnmpOptions, you have:

timeout => $default_timeout,
retries => $default_retries,
backoff => $default_backoff,
default_max_repetitions => $max_repetitions,

The meanings of “$default_timeout” and “$default_retries” are not documented, and “timeout” does not appear in /usr/bin/mrtg. Searching Github reveals that they are defined inside SNMP_Session. The documentation should not be using unexplained variables — there needs to be a clear explanation of where these values come from.

Also, within SNMP_Session itself, the definition of “backoff” is not clear. Under the definition of $default_timeout, the comment notes, “Note that when a request is retried, the timeout is increased by BACKOFF (see below).” I read this as suggesting that the back-off amount is added, although the comment under $default_backoff mentions “factor”, correctly implying that multiplication occurs.

As regards the SnmpOptions setting, I don’t understand this remark in the documentation: “Apart from the per target timeout options, you can also configure the behaviour of the snmpget process on a more profound level.” What is a more profound level? Considering the comment that these settings OVERRIDE the per target timeout settings” — if anything is going to be “more profound”, I would say that having the default value override individual hosts (!!) would be the one “profound” setting, whereas the previously-mentioned comment suggests that this is the only non-profound setting …

¿Que?

new ifTypes needed

Hi.

A number of network vendors and older software on those vendor gear report ifType 53 as IEEE 802.3ad interfaces. More and more are moving the the IANA ifType assigned number of 161 (ref: https://www.ietf.org/assignments/ianaiftype-mib/ianaiftype-mib).

Today cfgmaker only supports entries types 1 through 142 then jumps to 162. 161 is:
ieee8023adLag (161), -- IEEE 802.3ad Link Aggregate

Could you please add this (or maybe the rest of the list) into cfgmaker as well?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.