lost and found ( for me ? )

Ubuntu 12.04: monitor system resource with netmrg

Here are trial and error logs when installing netmrg.

about netmrg

# tail -1 /etc/lsb-release ;uname -ri
3.2.0-58-virtual x86_64

The installation procedures are:

- install mysql and create a database for netmrg
- install net-snmp and MIB files
- install netmrg and configure it

at first, install mysql server and run mysql server before installing netmrg
# apt-get install mysql-server

confirm that mysql is running.
# pgrep mysql

then, install netmrg.
# apt-get install netmrg
during the installation, you will be asked for the database name for netmrg.
I use “netmrg” as database name which is default setting.

confirm “netmrg” database exits.
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 65
Server version: 5.5.34-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
| Database           |
| information_schema |
| mysql              |
| netmrg             |
| performance_schema |
| test               |
5 rows in set (0.00 sec)

mysql> quit

edit apache2.conf
# tail -1 /etc/apache2/apache2.conf
Include /etc/netmrg/netmrg.conf

start httpd.
# apachectl start

access to http:// IP /netmrg
The default login is admin and the default password is nimda

collect data every 5 minutes
# pwd

# cat netmrg
# Regular cron jobs for the netmrg package
*/5 * * * * netmrg test -x /usr/bin/netmrg-gatherer && /usr/bin/netmrg-gatherer -l31

how can I manage my ubuntu box?
Seen from documents (http://wiki.netmrg.net/wiki/Basic_Tutorial), need to add the device which I would like to monitor.

Before adding the device, install net-snmp.
# apt-get install snmp snmpd

edit /etc/snmp/snmpd.conf
# egrep -v ^# /etc/snmp/snmpd.conf | grep -v ^$ | grep -v "#"
view   systemonly  included   .1
rocommunity public  localhost
rocommunity public  default    -V systemonly
rouser   authOnlyUser
sysLocation    Sitting on the Dock of the Bay
sysContact     Me <me@example.org>
sysServices    72
proc  mountd
proc  ntalkd    4
proc  sendmail 10 1
disk       /     10000
disk       /var  5%
includeAllDisks  10%
load   12 10 5
trapsink     localhost public
iquerySecName   internalUser
rouser          internalUser
defaultMonitors          yes
linkUpDownNotifications  yes
extend    test1   /bin/echo  Hello, world!
extend-sh test2   echo Hello, world! ; echo Hi there ; exit 35
master          agentx

restart snmpd
# service snmpd restart

issue snmpbulkwalk to check you can get information.
# snmpbulkwalk -v 2c -c public . | head -3
iso. = STRING: "Linux ubuntu 3.2.0-58-virtual #88-Ubuntu SMP Tue Dec 3 17:58:13 UTC 2013 x86_64"
iso. = OID: iso.
iso. = Timeticks: (4057) 0:00:40.57

On the netmrg GUI, add the device.

Admin tab -> Add

clieck group “HOME” -> Add in the Monitored Devices section -> Create a new device

create a new sub device
sub-device type: Group

add graph you want to monitor

can’t see the graph.
Seen from the GUI, SNMP failed..

rrd files are stored under /var/lib/netmrg/rrd directory for sure.
# pwd

# ls
mon_27.rrd  mon_29.rrd  mon_31.rrd  mon_33.rrd  mon_35.rrd  mon_37.rrd
mon_28.rrd  mon_30.rrd  mon_32.rrd  mon_34.rrd  mon_36.rrd  zero.rrd

Googling “netmrg snmp failed”, it seems that I need to install MIB files.
# apt-get install snmp-mibs-downloader
# download-mibs

edit /etc/snmp/snmp.conf
# egrep -v ^# /etc/snmp/snmp.conf
mibs +ALL


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.