The post Install logtail on CentOS appeared first on Justin Silver.
]]>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.
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.
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.
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.
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.
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.
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%]
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.
]]>The post Change Interval in Munin With Existing RRD Data appeared first on Justin Silver.
]]>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.
]]>The post Munin mysql_ suggest Cache::Cache Error appeared first on Justin Silver.
]]>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
Unable to suggest the plugin options.
[root@db1 plugins]# ./mysql_ suggest Missing dependency Cache::Cache at ./mysql_ line 728.
Install Perl’s Cache::Cache.
yum -y install perl-Cache-Cache.noarch
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.
]]>