Wednesday, February 26, 2014

Issue with nagios notify ping 'WARNING'

I installed nagios version 4.0.2 on CentOS 6.5 64bit from source, the installation succeeded  and nagios could start. However there is issue with notification when nagios checking 'check_ping' command, the host is alive and packet lost is 0%, nagios still send alert to my email. This is quite annoying.

Email notification like this:

***** Nagios *****

Notification Type: RECOVERY

Service: PING
Host: x.x.x.x
Address: x.x.x.x
State: OK

Date/Time: Wed Feb 26 16:08:46 ICT 2014

Additional Info:

PING OK - Packet loss = 0%, RTA = 341.55 ms

After searching around, I found solution related to check_ping command defined in /usr/local/nagios/etc/objects/commands.cfg. You need to make the check_ping command definition the same as check-host-alive. Otherwise you will get the same notification when it happens next.

define command{
        command_name    check-host-alive
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5

        }

define command{
        command_name    check_ping
        #command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5

        }

Monday, February 17, 2014

ORA-01194: file 1 needs more recovery to be consistent : No archivelog database asking for recovery

ORA-01194: file 1 needs more recovery to be consistent

This is the case datafiles were inconsistent and it is asking for recovery when you try to start the noarchivelog mode database.

Step 1: Start the database in mount.
$sqlplus / as sysdba

SQL>startup mount;

Step 2: Check the datafiles which required recovery.
SQL>select * from v$recover_file;

Step 3: As you do not have the needed archivelogs to recover those files, you should drop them offline then recover database and open.

SQL>alter database datafile <FILE#> offline drop;

NOTE: For sure you will loose data inside those files.

Step 4: Recover the database.
SQL>recover database;

If you come across below error

ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

then, do the following
SQL>recover database using backup controlfile until cancel;

It will ask to Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

When the session request a sequence for recovery please point write the path of the each online redolog one after another untill its say database recovered. You can select the redolog member from below query.

SQL>select group#, member FROM v$logfile;
    GROUP#
----------
MEMBER
--------------------------------------------------------------------------------
         3
/home/oracle/u01/oradata/SID/redo03.log

         2
/home/oracle/u01/oradata/SID/redo02.log

         1
/home/oracle/u01/oradata/SID/redo01.log
NOTE: Please repeat the recovery process, When the session request a sequence for recovery please point write the path of the online redolog:

Step 5: Then open the database resetlogs.
SQL>alter database open resetlogs;

Wednesday, February 12, 2014

Nano – Shortcuts, Syntax Highlight And Nanorc Config File

I have been using nano as my favorite console editor (i use emacs/kate for the rest) for some time now. It’s simplicity, the speed and usefulness of it made it what it is. But recently, i’ve been trying to find out more features that i might been missing. One of those were the shortcuts. The other was syntax highlighting! Meanwhile, the things i discovered!

Before we start, here’s some useful links:

So let’s start with the basic shortcuts!
“Special functions use the Control (Ctrl) key, displayed in the help and shortcut lists as ^; the Meta key, displayed as M; or the Escape (Esc) key.”
The help system in nano is available by pressing ^G.