How to do DNS lookup using Dig Command

Dig command is a command line tool use for querying DNS nameservers for information about host addresses, mail exchanges, nameservers, and related information. This tool is available on any Linux (unix) or Mac OS X operating system.

Example of using Dig Command

munkwais-MacBook-Pro:~ munkwai$ dig www.google.com

; <<>> DiG 9.8.3-P1 <<>> www.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32350
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.google.com. IN A

;; ANSWER SECTION:
www.google.com. 299 IN A 173.194.126.80
www.google.com. 299 IN A 173.194.126.81
www.google.com. 299 IN A 173.194.126.83
www.google.com. 299 IN A 173.194.126.82
www.google.com. 299 IN A 173.194.126.84

;; Query time: 44 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Apr 16 04:29:00 2015
;; MSG SIZE rcvd: 112

Continue reading

How to gracefully restarting the Apache httpd daemon

ApacheToday i received an email from our customer said that they do not know how to restart the Apache Web Server graceful. Restarting Apache Web Server also known as gracefully restarting the Apache httpd daemon.

Gracefully restarting httpd daemon will ensures that existing processes are allowed to finish serving the current page. Besides, it will reduce the chance of disrupting a user’s browsing experience.

How do i gracefully restart Apache Web Server?

To gracefully restart Apache web server. Please enter following command as the root user:-

Under Debian / Ubuntu Linux

apache2ctl graceful

Under RedHat / Centos / Fedora Linux

apachectl -k graceful

Continue reading

UNKNOWN: iostat not found or is not executable by the nagios user.

When i setup nagios monitoring for my ubuntu server, i noticed that there is an unknown status on CPU stats services.

nagios

I try to run check_cpu_stats command, i still get the same error also.

root@ADC-152-LIN-01:/usr/lib/nagios/plugins# sh check_cpu_stats.sh
UNKNOWN: iostat not found or is not executable by the nagios user.

From the error show, it seems like iostat not install on the Server. I try to install sysstat to see whether it work or not.

root@ADC-152-LIN-01:/usr/lib/nagios/plugins# apt-get install sysstat

After install, i tried to execute check_cpu_stats command. It work fine.

root@ADC-152-LIN-01:/usr/lib/nagios/plugins# sh check_cpu_stats.sh
CPU STATISTICS OK: user=0.00% system=0.00% iowait=0.00% idle=100.00% | user=0.0% system=0.0% iowait=0.0%;30;100 idle=100.00%

Please do share with me if you have any others alternative way to solve this problem. 🙂