Linux administration , Unix administration , Vmware Vsphere administration , Oracle DBA ,apache, backup, dhcp, dns, kvm, xen, kernel, ldap, kvm, monitoring, ticketing, networking, Mail servers, SAN,troubleshooting
Labels
- Amanda (2)
- Ansible (2)
- Answer these Questions (2)
- antivirus (2)
- apache (3)
- Bash (16)
- Chef (3)
- Citrix (2)
- clusters (2)
- Concept (22)
- DatabaseAdminstration (11)
- DevOps (1)
- dhcp (2)
- Downloads (3)
- ELK (1)
- ELK stack (1)
- encryption (1)
- Free trainings (1)
- Frequently Used Commands (46)
- FTP (1)
- git (1)
- gpg (2)
- Hardware (1)
- httpd (2)
- Interview Questions (53)
- iptables (1)
- IT NEWS (3)
- java (1)
- kibana (2)
- knife (1)
- KVM (2)
- linux (17)
- Linux installations (22)
- Linux Jobs (4)
- Linux Links (2)
- logstash (1)
- Mac (1)
- MediaWiki (1)
- MySql (2)
- Nagios (2)
- Networking (3)
- open Nebula (5)
- Open Source tools (12)
- OpenNMS (1)
- openSSL (1)
- Oracle on Linux (5)
- Performance Monitoring (1)
- php (1)
- postfix (1)
- postgres (1)
- postgres-XL (1)
- Product Reviews (1)
- Python (2)
- rssh (1)
- Samba (2)
- Scripting (16)
- security (4)
- selinux (1)
- Server (1)
- SFTP (1)
- Social Awareness (1)
- Solaris (1)
- SSL (1)
- svn (1)
- TCP/IP (1)
- Technology (1)
- Tips and Tricks (32)
- Training and materials (8)
- Troubleshooting (6)
- Ubuntu (18)
- unix (1)
- virtualization (17)
- Vmware (25)
- Vyatta (1)
- windows7 (1)
- xml (1)
To Know Which Shell You Are Working
Installing and Configuring Monit Step by Step
install and configure monit
apt-get install monit
Monit Configuration file is /etc/monit/monitrc
for example sshd,apache,Mysql
Now for monit web interface the default port number is 2812
Now let us configure the monit
vi /etc/monit/monitrc
--------------------------------------------------------------------------------------------------------------------
set daemon 60 // time interval of the daemon set logfile syslog facility log_daemon set mailserver localhost set mail-format { from: monit@server1.example.com } set alert root@localhost // mail id to send email alerts set httpd port 2812 and // If you want to chang port number change here better leave it default SSL ENABLE // for SSL PEMFILE /var/certs/monit.pem // SSL certificate location allow admin:test // user name and password Basic Auth // monitoring sshd check process sshd with pidfile /var/run/sshd.pid start program "/etc/init.d/ssh start" stop program "/etc/init.d/ssh stop" if failed port 22 protocol ssh then restart if 5 restarts within 5 cycles then timeout
// monitoring mysql check process mysql with pidfile /var/run/mysqld/mysqld.pid group database start program = "/etc/init.d/mysql start" stop program = "/etc/init.d/mysql stop" if failed host 127.0.0.1 port 3306 then restart if 5 restarts within 5 cycles then timeout
// monitoring apache check process apache with pidfile /var/run/apache2.pid group www start program = "/etc/init.d/apache2 start" stop program = "/etc/init.d/apache2 stop"
if failed host www.example.com port 80 protocol http and request "/monit/token" then restart
here monit tries to connect www.example.com on port 80 and tries to access a file
/monit/token
the actual location of /monit/token is
/var/www/www.example.com/web/monit/token
as our website document root is
/var/www/www.example.com/web
if monit cannot access this file it means apache is not runnig so it will
restart apache.
Creation of token is given below
if cpu is greater than 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 500 MB for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if 3 restarts within 5 cycles then timeout
you can add your custom process for
monitoring here
----------------------------------------------------------------------------------------------------------------
Creation of token
---------------------
mkdir /var/www/www.example.com/web/monit
echo "hello" > /var/www/www.example.com/web/monit/token
Creation of SSL-encrypted monit web interface
-----------------------------------------------------------------
( /var/certs/monit.pem )
openssl req -new -x509 -days 365 -nodes -config ./monit.cnf -out /var/certs/monit.pem -keyout /var/certs/monit.pem
openssl gendh 512 >> /var/certs/monit.pem
openssl x509 -subject -dates -fingerprint -noout -in /var/certs/monit.pem
chmod 700 /var/certs/monit.pem
then we need to configure OpenSSL configuration file to create our certificate
vi /var/certs/monit.cnf
example file is
-------------------------------------------------------------------------------------------
# create RSA certs - Server RANDFILE = ./openssl.rnd [ req ] default_bits = 1024 encrypt_key = yes distinguished_name = req_dn x509_extensions = cert_type [ req_dn ] countryName = Country Name (2 letter code) countryName_default = MO stateOrProvinceName = State or Province Name (full name) stateOrProvinceName_default = Monitoria localityName = Locality Name (eg, city) localityName_default = Monittown organizationName = Organization Name (eg, company) organizationName_default = Monit Inc. organizationalUnitName = Organizational Unit Name (eg, section) organizationalUnitName_default = Dept. of Monitoring Technologies commonName = Common Name (FQDN of your server) commonName_default = server.monit.mo emailAddress = Email Address emailAddress_default = root@monit.mo [ cert_type ] nsCertType = server
------------------------------------------------------------------------------
enable monit daemon now
/etc/default/monit
in this file set startup =1 and interval for running the monit daemon
example file is below
--------------------------------------------------------------
# Defaults for monit initscript # sourced by /etc/init.d/monit # installed at /etc/default/monit by maintainer scripts # Fredrik Steen# You must set this variable to for monit to start startup=1 # To change the intervals which monit should run uncomment # and change this variable. CHECK_INTERVALS=60
---------------------------------------------------------------
now let us start monit
/etc/init.d/monit start
Now point your browser to https://www.example.com:2812/ (make sure port 2812 is not blocked by your firewall), log in with admin and test
as specified in /etc/monit/monitrc
How to rename temp files in temporary tablespace
SHUTDOWN
STARTUP MOUNT
ALTER DATABASE RENAME FILE 'oldpath' TO 'newfile path';
ALTER DATABASE OPEN;
delete older file
STARTUP MOUNT
ALTER DATABASE RENAME FILE 'oldpath' TO 'newfile path';
ALTER DATABASE OPEN;
delete older file
Steps to start the multiple listener in Oracle
$lsnrctl
LSNRCTL>set current DEMO
LSNRCTL> start
LSNRCTL> set current PROD
LSNRCTL> start
LSNRCTL>set current DEMO
LSNRCTL> start
LSNRCTL> set current PROD
LSNRCTL> start
EMC Training material download
STF-1_Storage_Concepts.pdf
Size: 612 KB
STF-2_Storage_Architecture.pdf
Size: 4357 KB
STF-3_Networked_Storage.pdf
Size: 3465 KB
STF-4_Business_Continuity.pdf
Size: 1773 KB
STF-5_Monitoring___Managing_the_DataCenter.pdf
Size: 1168 KB
STF-6_Storage_Virtualizations.pdf
Size: 3249 KB
How does DNS work step by step
Client enters a domain name (www.domainname.com) into his browser
The browser contacts the Client's ISP for the IP address of the domain name
The ISP first tries to answer by itself using "cached" data.
If the answer is found it is returned. Since the ISP isn't in charge of the DNS, and is just acting as a "dns relay", the answer is marked "non-authoritative"
If the answer isn't found, or it's too old (past the TTL), then the ISP DNS contacts the nameservers for the domain directly for the answer.
If the nameservers are not known, the ISP's looks for the information at the 'root servers', or 'registry servers'. For com/net/org, these start with a.gtld-servers.net.
NOTE: The 'whois' information is never used for DNS, and is often misleading and inaccurate
For More Detaild Explanation Click Here
ZFS file system Step by Step
ZFS stands for Zettabyte File System .
It is designed by Sun Microsystems for the Solaris Operating.
The features of ZFS include support for high storage capacities, integration of the concepts of filesystem and volume management, snapshots and copy-on-write clones, continuous integrity checking and automatic repair, RAID-Z and native NFSv4 ACLs. ZFS is implemented as open-source software, licensed under the Common Development and Distribution License (CDDL).
Some of the benefits of the ZFS file system:
- Filesystem and Volumemanger in one system
- Easy administration with only 2 commands - #zpool and #zfs
- advanced raid level and functions
- snapshots
- automatic checksum over all data
- 128 Bit
- automatic shrinking and growing volumes
- No RAID cards required, using ZFS built in RAID-Z redundancy. (reduces hardware cost drastically)
- Effective and Optimal SnapShots
- Compressed Zpools.
- Built in NFS/ISCSI/SMB Sharing
- Support PNFS for high speed interconnects. (Will use all the 6 GigE ports)
Configuring ZFS
Permitted subcommands are list, iostat, status, online,
offline, scrub, import, and history.
offline, scrub, import, and history.
Find version of ZFS
# kextstat | grep zfs
zpool - configuring zfs storage pools
# zpool create myzfs /disk1 /disk2
# zpool create mypool mirror disk1s1 disk0s1 mirror disk1s2 disk0s2
# mkfile 100m disk1 disk2 disk3 disk5# mkfile 50m disk4
# ls -l disk*
-rw------T 1 root root 104857600 Sep 11 12:15 disk1
-rw------T 1 root root 104857600 Sep 11 12:15 disk2
-rw------T 1 root root 104857600 Sep 11 12:15 disk3
-rw------T 1 root root 52428800 Sep 11 12:15 disk4
-rw------T 1 root root 104857600 Sep 11 12:15 disk5
Creating hot spares
when any disk goes down the disk marked as hotspare will
automatically take its functionality after it gets replaced.
# zpool create pool mirror disk0 disk1 spare disk2 disk3
These spares can be across multiple pools and can be added
with zpool add and removed with zpool remove
Automated Installation of MySQL without asking password
is your the installation process pops up a blue dialog asking for a root password ?? want to make automated
without the asking of password then
First give this two commands
echo "mysql-server mysql-server/root_password select (password omitted)" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again select (password omitted)" | debconf-set-selections
Then the installation will not ask for passowrd then continue installation.
apt-get install mysql-client-5.1 mysql-server-5.1 -y
without the asking of password then
First give this two commands
echo "mysql-server mysql-server/root_password select (password omitted)" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again select (password omitted)" | debconf-set-selections
Then the installation will not ask for passowrd then continue installation.
apt-get install mysql-client-5.1 mysql-server-5.1 -y
Subscribe to:
Posts (Atom)