Linux
Script to install RabbitMQ 3.7.9 on Centos7
Script to install RabbitMQ 3.7.9 on CentOS 7 #!/bin/bash # README # ONLY VARIABLE REQUIRED IS admin password for "rabbitmqctl add_user admin {MyPassword}" # PLease change before running script. # echo "#######################################################################"; echo "This script will install RabbitMQ 3.7.9 and open relevant firewall rules"; echo "#######################################################################"; yum -y install epel-release wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm rpm -Uvh […]
Create LACP Bond Interface in Centos 7
Issue I had two 10Gb ports I wanted to bond in Dynamic Link Aggegration (802.3ad) To get the network interface list use: nmcli connection In my output I wanted to use ens1f0 and ens1f1 interfaces Steps 1) Create Bond Interface (bond0) nmcli con add type bond con-name bond0 ifname bond0 mode 4 ip4 10.32.99.12/24 10.32.99.254 […]
Init: Private key not found – Apache Wont Start on CentOS
Problem When attempting to update a certificate in Apache the webserver would not restart. Apache Error Logs: [Tue Oct 29 14:42:07 2019] [error] Init: Private key not found [Tue Oct 29 14:42:07 2019] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag [Tue Oct 29 14:42:07 2019] [error] SSL Library Error: 218640442 error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 […]
Script to Copy Yesterdays DB Backup to Remote Site
The following script will pick out yesterdays backup file and copy it over to a remote site using SCP Note: The format of the backup files are in this format : db-08-10-2019.bak.gz Note: You will need to install sshpass (eg yum -y install sshpass) and be comfortable with your password being in cleartext. #!/usr/bin/bash # […]
User “postgres” Has No Password Assigned
Problem When trying to remotely connect to Postgres 10.10 install for the first time I got and authentication error via pgadmin From the log files (/var/lib/pgsql/10/data/log/postgresql-Wed.log) 2019-09-25 14:05:38.970 BST [22665] FATAL: password authentication failed for user "postgres" 2019-09-25 14:05:38.970 BST [22665] DETAIL: User "postgres" has no password assigned. Connection matched pg_hba.conf […]
Script to Customize CentOS 7 Install in a VMware Environment
#!/bin/bash echo "#######################################################################"; echo "This script will Update the OS, install useful tools and configure NTP"; echo "#######################################################################"; #Update OS yum update -y #install useful tools yum install telnet -y yum install bind-utils -y # install vmware tools yum install -y open-vm-tools systemctl enable vmtoolsd.service systemctl status vmtoolsd.service # Disable selinux /usr/bin/sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config […]
Route Commands on ESXi, VCSA, Linux & Windows
Sample route commands Windows Show routing table route print Add a persistent route ROUTE -p ADD 10.10.129.0 MASK 255.255.255.0 10.5.72.254 ESXi Show routing table esxcfg-route -l Show routing table for specific stack esxcfg-route -l -N (stack name) Add route esxcli network ip route ipv4 add –gateway 10.5.72.254 –network 10.10.129.0/24 VCSA Show routing […]
Upgrade Zabbix from 3.4 to 4.0 with Pacemaker/Corosync
Here are the instructions for upgrading Zabbix from 3.4 to 4.0 in a HA setup in a Pacemaker and Corosync environment. In this particular setup there are 6 servers – depicted below Two web front ends Two Zabbix Servers Two DB servers Steps Pre-requisite: As this was running in a VMware environment I snapshotted each […]
UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY
Problem A CentOS VM was rebooted but failed to start with the following error: /dev/ampper/VolGroup-lv_root: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY Solution 1) Enter CLI {Enter root password} 2) Run filesystem check . In my case. # fsck -y /dev/ampper/VolGroup-lv_root 3 Reboot system # reboot
Backup Postgres DB and Rotate using Logrotate – CentOS
Here is a rudimentary script to backup a specific Postgres DB. Logrotate then takes care of the log rotation. As you'll see below we will keep 7 days worth of compressed files. #! /bin/bash # This script is called from logrotate /etc/logrotate.d/my-dumps # It backs up myDB every evening and logrotate takes care of compression […]