Skip to main content

Posts

Showing posts from August, 2016

Moving RRD file from 32bit to 64bit Architecture

When we were working on a nagios monitoring system we were migrating from a 32bit nagios to a 64bit Architecture. Most of the graphs are not working as the RRD was from an older 32bit architecture. Location of perfdata on nagios server. [root @nagios -server perfdata] # pwd /usr/local/nagios/share/perfdata Error when we load the graph. ERROR : This RRD was created on another architecture This can re solved by converting the exsisting 32bit RRD to XML and then restoring into the new 64bit Architecture. Creating a xml dump for rrd file. rrdtool dump cpu_load.rrd > cpu_load.xml Move the XML file to the new server (64bit) Restore the XML file back. rrdtool restore -f cpu_load.xml cpu_load.rrd Testing if the RRD file is create fine, use below command. rrdtool info cpu_load.rrd Now you should be able to see all the graphs on the server. ​

Remove Old Files using find Command

GNU find searches the directory tree rooted at each given file name by evaluating the given expression from left to right, according to the rules of precedence, until the outcome is known (the left hand side is false for and operations, true for or), at which point find moves on to the next file name. Remove old files which are older than a specific time using find Command Command find /path/to/files* -mtime + 5 -exec rm {} \; Note that there are spaces between rm , {} , and \; Command Explanation. -mtime n File 's data was last modified n*24 hours ago. See the comments for -atime to understand how rounding affects the interpretation of file modification times. -exec command {} + This variant of the -exec action runs the specified command on the selected files, but the command line is built by appending each selected file name at the end; the total number of invocations of the command will be much less than the number of ma...

Migrating Nagios XI to a New Server on Centos6.6

Migrating an old Nagios backup to a new nagiosxi server. Migration is simple in Nagios XI, you a backup and restore it. Once that is done we need to update/add the clients with IP of the new server, so that both Nagios get alerts. After a while once we are comfortable with the new server we can decommission the old one. For example we will use two servers. old_nagios (nagiosximon) new_nagios (nagioserver) Backup from Old Server. Lets first take a backup from the old_nagios server. [root@nagiosximon ~]# /usr/local/nagiosxi/scripts/backup_xi.sh Running configuration check... Stopping nagios: done. Starting nagios: done. Backing up Core Config Manager (NagiosQL)... tar: Removing leading `/' from member names tar: Removing leading `/' from member names Backing up Nagios Core... tar: Removing leading `/' from member names tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored tar: /usr/local/nagios/var/ndo.sock: socket ignored Backing up Nagios XI... tar: Removi...

Setting up ssl https On Nagios XI Server

HTTPS is a protocol for secure communication over a computer network which is widely used on the Internet. HTTPS consists of communication over Hypertext Transfer Protocol (HTTP) within a connection encrypted by Transport Layer Security or its predecessor, Secure Sockets Layer. The main motivation for HTTPS is authentication of the visited website and protection of the privacy and integrity of the exchanged data. Intro Courtesy Wikipedia Full SSL support requires Nagios XI version 2011R1.6 or later. Before we start. Check if the below packages are install, they should be if you are using latest Nagios XI, but check them anyways. yum install mod_ssl openssl Creating Key and Certificate Lets generate the key for the server. openssl genrsa -out ca.key 2048 Output for the command. [ahmed@nagiosserver ~]$ openssl genrsa -out ca.key 2048 Generating RSA private key, 2048 bit long modulus ...........................................................................................

Update hosts file in Windows 8

Host file contains IP followed by the FQDN which can be used to reach that IP address. Host file takes precedence over your DNS servers. In Microsoft operating systems, the HOSTS file is located in the following location: C:\Windows\System32\Drivers\etc You will see a file called host below are the contents. # Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x...