Red hat linux Shell scripting

AWK and Regular Expressions to Filter Text or String in Files

AWK is an interpreted programming language. It is very powerful and specially designed for text processing. AWK – Basic Examples This chapter describes several useful AWK commands and their appropriate examples. Consider a text file marks.txt to be processed with the following content − 1) Amit Physics 80 2) Rahul Maths 90 3) Shyam Biology […]

Red hat linux Web Hosting

Howto install sar & ksar system activity info in Centos / Redhat

The sar command collect, report, or save UNIX / Linux system activity information. It will save selected counters in the operating system to the /var/log/sa/sadd file. Fromlinux-logo the collected data, you get lots of information about your server: CPU utilization Memory paging and its utilization Network I/O, and transfer statistics Process creation activity All block […]

nagios Red hat linux

Send SNMP Traps from Nagios to Remote Management Host

1. Add ‘send snmp trap’ command to nagios vim /usr/local/nagios/etc/objects/commands.cfg define command{ command_name send_snmptrap command_line /usr/bin/snmptrap -v 2c -c public 10.50.24.34 ” NAGIOS-NOTIFY-MIB::nSvcEvent nSvcHostname s “$HOSTNAME$” nSvcDesc s “$SERVICEDESC$” nSvcStateID i $SERVICESTATEID$ nSvcOutput s “$SERVICEOUTPUT$” } 2. Add this event and enable the event to services which needed to send traps vim /usr/local/nagios/etc/objects/localhost.cfg define service{ […]

Red hat linux

How To Install and Configure SNMP on RHEL 7 or CentOS 7

SNMP stands for “Simple Network Management Protocol”, it can be utilized to monitor any devices that support snmp, few of the devices are server, router, network printers, firewalls. SNMP can monitor a variety of parameters for these devices such as server performance, network usage, disk utilization. Check Package Check if the package is already installed, […]

Uncategorized

Useful MySQL Commands

Database with size SELECT table_schema “DB Name”, Round(Sum(data_length + index_length) / 1024 / 1024, 1) “DB Size in MB” FROM information_schema.tables GROUP BY table_schema; Create a database. mysql> create database [databasename]; List all databases on the server. mysql> show databases; Switch to a database. mysql> use [db name]; To see all the tables in the […]

MySQL Red hat linux

Password Validation Plugin in MySQL

The validate_password plugin serves to test passwords and improve security. The plugin exposes a set of system variables that enable you to define password policy. First check the plugin directory of MySQL. mysql> show variables like “plugin%”; +—————+————————–+ | Variable_name | Value | +—————+————————–+ | plugin_dir | /usr/lib64/mysql/plugin/ | +—————+————————–+ 1 row in set (0.00 […]

Red hat linux

Set Up and Use Yum Repositories on Redhat / CentOS

We can install new software on Red Hat/CentOS Linux with “yum install packagename” command from console. Running this command first checks for existing YUM Repository configuration files in /etc/yum.repos.d/ directory. It reads each YUM Repository configuration file to get the information required to download and install new software, resolves software dependencies and installs the required […]