Munin Archives - Justin Silver https://www.justinsilver.com/tag/munin/ Technology, Travel, and Pictures Wed, 18 Nov 2015 01:33:45 +0000 en-US hourly 1 https://wordpress.org/?v=6.0.1 https://www.justinsilver.com/wp-content/uploads/2013/06/cropped-apple-touch-icon-160x160.png Munin Archives - Justin Silver https://www.justinsilver.com/tag/munin/ 32 32 Install logtail on CentOS https://www.justinsilver.com/technology/linux/install-logtail-centos/?utm_source=rss&utm_medium=rss&utm_campaign=install-logtail-centos https://www.justinsilver.com/technology/linux/install-logtail-centos/#respond Mon, 02 Jun 2014 22:09:36 +0000 http://justin.ag/?p=3599 The developer of logtail has not made the repository available via yum for quick installation. Even if you don’t want to access logtail from the command line, it is still used by several other scripts...

The post Install logtail on CentOS appeared first on Justin Silver.

]]>
AmpedSense.OptimizeAdSpot('AP'); AmpedSense.OptimizeAdSpot('IL'); AmpedSense.OptimizeAdSpot('IR');

The developer of logtail has not made the repository available via yum for quick installation. Even if you don’t want to access logtail from the command line, it is still used by several other scripts and plugins, such as the Nginx plugins for Munin. The easiest way to do this is to install logcheck, which includes logtail. You can use rpm to handle the install, but you will need to install some dependencies first.

Install Dependencies

Use rpm to install the logtail dependencies in the order below – liblockfile, lockfile-progs, perl-mime-construct, and perl-Proc-WaitState. If you already have one of these packages rpm should let you know when you try to re-install it.

liblockfile

rpm -ivh ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/liblockfile-1.08-9.el5.i386.rpm
Retrieving ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/liblockfile-1.08-9.el5.i386.rpm
Preparing...                ########################################### [100%]
   1:liblockfile            ########################################### [100%]

liblockfile was successfully installed.

lockfile-progs

rpm -ivh ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/lockfile-progs-0.1.15-2.el5.i386.rpm
Retrieving ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/lockfile-progs-0.1.15-2.el5.i386.rpm
Preparing...                ########################################### [100%]
   1:lockfile-progs         ########################################### [100%]

lockfile-progs was successfully installed.

perl-mime-construct

rpm -ivh ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/perl-mime-construct-1.11-2.el5.noarch.rpm
Retrieving ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/perl-mime-construct-1.11-2.el5.noarch.rpm
Preparing...                ########################################### [100%]
	package perl-mime-construct-1.11-2.el5.noarch is already installed

perl-mime-construct was already installed.

perl-Proc-WaitStat

rpm -ivh ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/perl-Proc-WaitStat-1.00-2.el5.noarch.rpm
Retrieving ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/perl-Proc-WaitStat-1.00-2.el5.noarch.rpm
Preparing...                ########################################### [100%]
	package perl-Proc-WaitStat-1.00-2.el5.noarch is already installed

perl-Proc-WaitStat was already installed.

Install logcheck

Now we’re ready to install logcheck. Use the following rpm to wrap up the install.

rpm -ivh ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/logcheck-1.3.13-6.el5.noarch.rpm
Retrieving ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/logcheck-1.3.13-6.el5.noarch.rpm
Preparing...                ########################################### [100%]
   1:logcheck               ########################################### [100%]

Run logtail

Now that logcheck is installed, you should be able to call logtail from the command line, or other scripts and plugins.

[root@web1 ~]# logtail
No logfile to read. Use -f [LOGFILE].

The post Install logtail on CentOS appeared first on Justin Silver.

]]>
https://www.justinsilver.com/technology/linux/install-logtail-centos/feed/ 0
Change Interval in Munin With Existing RRD Data https://www.justinsilver.com/technology/linux/change-interval-munin-existing-rrd-data/?utm_source=rss&utm_medium=rss&utm_campaign=change-interval-munin-existing-rrd-data https://www.justinsilver.com/technology/linux/change-interval-munin-existing-rrd-data/#respond Tue, 15 Apr 2014 04:15:28 +0000 http://justin.ag/?p=3452 The default settings for Munin will result in RRD files containing 5 minute intervals of data, or 300 seconds as it is stored internally. It is possible to change this interval by changing /etc/cron.d/munin....

The post Change Interval in Munin With Existing RRD Data appeared first on Justin Silver.

]]>
AmpedSense.OptimizeAdSpot('AP'); AmpedSense.OptimizeAdSpot('IL'); AmpedSense.OptimizeAdSpot('IR');

The default settings for Munin will result in RRD files containing 5 minute intervals of data, or 300 seconds as it is stored internally. It is possible to change this interval by changing /etc/cron.d/munin. It’s also necessary to change the update_rate in your Munin configuration, usually found in /etc/munin-node.conf. This value should match the resolution of the munin cron.

If you make this change before you start collecting data, great! If you do already have historical data that you want to keep, you need to convert the data to work with the new interval. The only documentation I was able to find on this matter on the Munin site was issue #1282 update_rate needs documentation, which in turn referenced http://www.elturista.net/2012/01/02/changing-step-time-of-a-rrd-file/ however this file is no longer available. I was able to locate it using the WayBack Machine, and in the interest of preservation I am reposting here with additional updates of my own.

rrdtool dump file.rrd > file.5.xml
./rrd_step_reduce.py file.5.xml 5 > file1.xml
rrdtool restore file1.xml file.rrd
#!/usr/bin;/python
# -*- coding: utf-8 -*-

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys
from copy import deepcopy
from StringIO import StringIO

try:
    from lxml import etree
except ImportError:
    try:
        import xml.etree.cElementTree as etree
    except ImportError:
        try:
            import xml.etree.ElementTree as etree
        except ImportError:
            try:
                import cElementTree as etree
            except ImportError:
                try:
                    import elementtree.ElementTree as etree
                except ImportError:
                    raise

def main(dumpfile, factor):
        
    xmldoc = etree.parse(dumpfile)
    root = xmldoc.getroot()
    
    # change step, reducing it by a factor of "factor"
    step = root.find("step")
    assert(step!=None)
    old_step = int(step.text)
    new_step = old_step/factor
    step.text = str(new_step) 
    
    database = root.findall("rra/database")
    for d in database:
        index = 0
        count = len(d)
        while count > 0:
            for i in range(0, factor-1):
                #d.insert(index+1, NaNdoc.getroot())
                d.insert(index+1, deepcopy(d[index]))
            index = index + factor
            count = count - 1
    
    print etree.tostring(root)

if __name__ == "__main__":
    # arguments
    if len(sys.argv) != 3:
        print "rrd_step_reduce.py rrddump.xml factor"
        sys.exit(-1)
    
    # call main
    main(sys.argv[1], int(sys.argv[2])))

The post Change Interval in Munin With Existing RRD Data appeared first on Justin Silver.

]]>
https://www.justinsilver.com/technology/linux/change-interval-munin-existing-rrd-data/feed/ 0
Munin mysql_ suggest Cache::Cache Error https://www.justinsilver.com/technology/linux/munin-mysql_-suggest-cachecache-error/?utm_source=rss&utm_medium=rss&utm_campaign=munin-mysql_-suggest-cachecache-error https://www.justinsilver.com/technology/linux/munin-mysql_-suggest-cachecache-error/#respond Mon, 14 Apr 2014 03:57:41 +0000 http://justin.ag/?p=3434 I was trying to set up the newer mysql_ plugin for Munin, but got the following error when using the “suggest” argument to determine how to link the file. The “fix” was to install...

The post Munin mysql_ suggest Cache::Cache Error appeared first on Justin Silver.

]]>
AmpedSense.OptimizeAdSpot('AP'); AmpedSense.OptimizeAdSpot('IL'); AmpedSense.OptimizeAdSpot('IR');

I was trying to set up the newer mysql_ plugin for Munin, but got the following error when using the “suggest” argument to determine how to link the file. The “fix” was to install the perl-Cache-Cache.noarch package via yum.

Missing dependency Cache::Cache at ./mysql_ line 728

As an FYI – you install different graphs from a single plugin by creating a symbolic link to the plugin with an appropriate name, for example:

ln -s mysql_ mysql_connections

The Error

Unable to suggest the plugin options.

[root@db1 plugins]# ./mysql_ suggest
Missing dependency Cache::Cache at ./mysql_ line 728.

The “Fix”

Install Perl’s Cache::Cache.

yum -y install perl-Cache-Cache.noarch

Success

You should now be able to suggest the plugin options.

[root@db1 plugins]# ./mysql_ suggest
bin_relay_log
commands
connections
files_tables
innodb_bpool
innodb_bpool_act
innodb_insert_buf
innodb_io
innodb_io_pend
innodb_log
innodb_rows
innodb_semaphores
innodb_tnx
myisam_indexes
network_traffic
qcache
qcache_mem
replication
select_types
slow
sorts
table_locks
tmp_tables

The post Munin mysql_ suggest Cache::Cache Error appeared first on Justin Silver.

]]>
https://www.justinsilver.com/technology/linux/munin-mysql_-suggest-cachecache-error/feed/ 0