Showing posts with label RHEL. Show all posts
Showing posts with label RHEL. Show all posts

Friday, June 22, 2012

Nagios issues, duh.

I went to go pull up the Nagios web interface yesterday and to my surprise received a "Error: Could not read object configuration data!". Troubleshooting here we come!

First things first, check the process
 # /etc/init.d/nagios status  
 nagios is stopped  


Not running? Odd. ok, start it up
 # /etc/init.d/nagios start  
 nagios is stopped  
 Configuration validation failed              [FAILED]  


Hmm.
 # /usr/bin/nagios -v /etc/nagios/nagios.cfg  
 Checking...  
  Total Warnings: 0  
 Total Errors:  0  
 Things look okay - No serious problems were detected during the pre-flight check  


So, I checked the log files and they are all from past dates, including nothing from the last day or so.
 # cat /var/log/nagios/nagios.log | perl -pe 's/(\d+)/localtime($1)/e' | less  

Nifty perl script there to fix the dates, but it's not mine, just a web snippet.


 I was stumped. Then I had a thought, SELinux errors...
 # getenforce  
 Enforcing

Ok, 
 # setenforce permissive 


and give it another shot,
 # /etc/init.d/nagios start  
 nagios is stopped  
 Starting nagios:                      [ OK ]  


As they say on Afrotechmods,


A lot of folks disable SELinux in their environments as it can get rather complicated. However, for this issue I was able to dig up this post regarding setting up a new type definition for Nagios, but haven't yet tried it myself.

http://fportase.wordpress.com/selinux-policies/nagios-and-rhel-5-xx-and-6-xx-working-with-selinux-enabled/

Monday, May 21, 2012

RHCSA "Cheat Sheet"

I've got the RHCSA scheduled for June 8th.Originally, I was scheduled to take the exam back in early April, but I had two classes cancelled on me. As it turns out, if the RH200 5 day class isn't booked by at least 4 people, the class and exam are cancelled. Consequently, it's best to call and book over the phone in order to see which classes are "GTR" or guaranteed to run.

In my final preperation for the RHCSA I've gone through and found some good references for a "cheat sheet," pulling from Michael Jang's RHCSA/RHCE study guide as well as this fantastic wiki: http://rhce.co/rhel6/Main_Page for those seeking their RHCSA.The RHCE portion is incomplete, but the RHCSA part is complete and only slightly outdated. It is a fantastic resource.

Between those two sources, notes from Tommasino's Hands-on Guide to the RHCSA/RHCE, and my personal knowledge, I put together this study guide based on the RE200 exam objectives as of 2012 05 15.


Objectives:

Understand and use essential tools

  • Access a shell prompt and issue commands with correct syntax.
    • Change TTY
      • ctrl+alt+F1 
        • F1-F7 are available
    • Icon on top of left of GUI
    • -Menu/Applications/System Tools/Terminal

  • Use input-output redirection (>, >>, |, 2>, etc.).
    • > overwright
    • < send into a command or file
    • >> append
    • << append into a command or file
      • cat >> hoge.txt << _end
        • cat the file
        • enter text in tot he file until _end has been met 
    • | funnel into
    • 2> redirect errors
    • 2>&1 redirect errors to std out

  • Use grep and regular expressions to analyze text.
    • grep for nocase 
      • # grep -i
    • egrep ‘^(wheel|root)’ /etc/group
    • less file | [e]grep string
    • inverted search with grep and egrep
      • grep -v ^# /etc/nsswitch.conf
        egrep -v ^# /etc/nsswitch.conf

  • Access remote systems using ssh and VNC.
    • SSH user_name@host
    • ssh with x windows pass through
      • SSH host -lX user_name
    • vncviewer remote_host

  • Log in and switch users in multiuser runlevels.
    • Runlevels 2, 3, 5
    • su - username

  • Archive, compress, unpack, and uncompress files using tar, star, gzip, and bzip2.
    • # gzip big.jpg
      # bzip2 big.jpg
      # gzip -d big.jpg.gz
      # bzip2 -d big.jpg.bz2
      # tar czvf home.tar.gz /home
      # tar xzvf home.tar.gz /home
      yum install star
      # star -xattr -H=exustar -c -f=home.star /home/
      # star -x -f=home.star

  • Create and edit text files.
    • touch filename
    • vi filename

  • Create, delete, copy, and move files and directories.
    • touch, rm, rmdir, rm -fr, cp, mv -r, mv

  • Create hard and soft links.
    • ln source destination ## hard link
    •  ln -s source dest, 

  • List, set, and change standard ugo/rwx permissions.
    • ls -l
    • chmod +x +w +r, 
    • chmod 755 ##folders default
    • chown user.group
    • chgrp

  • Locate, read, and use system documentation including man, info, and files in /usr/share/doc.
    • man command_name
    • man -k command_name
    • search for command in the doc directory
    • ls -l /usr/share/doc | grep httpd

Note: Red Hat may use applications during the exam that are not included in Red Hat Enterprise Linux for the purpose of evaluating candidate's abilities to meet this objective.