Debugging Salt States

Some tips and tricks to debug salt (states). Use salt-call on minion Useful to: Trigger the deployment with direct and verbose feedback on terminal Enables identification of slow state functions, i.e. repository refreshs Steps: Log into client machine, as root / sudo: salt-call -l debug state.highstate To apply a single state file (not recommended on […]

Graylog2 install Slack Notifications

The graylog Marketplace has a great document on getting started, but I ran into one snag adding HTTPS certificate to java store for hooks.slack.com. For reference here is link to marketplace  Required Graylog version: 2.0 and later. Detailed alarm notification and message output: This plugin can notify Slack or Mattermost channels about triggered alerts in Graylog (Alarm Callback) and also forward […]

Get package version in Salt

Having installed the latest version of package where it expects config files to do be in a path including the version number (e.g. postgresql-server), how can I get the installed version number in a variable to be used inside my state.sls file so the salt master can: manage the config files in the correct path use this for […]

Remove Whitespace from File and Directory Name

How to remove all white space from directory names and file names recursively. Use rename (aka prename) which is a Perl script which may be on your system already. Do it in two steps: find -name “* *” -type d | rename ‘s/ /_/g’ # do the directories first find -name “* *” -type f | rename ‘s/ […]

Sensu Uchiwa Dashboard “Internal 500 error”

Recently had an issue with ruby resolving to IPV6 resulting in failed login attempts for Uchiwa dashboard with Sensu-API. Uchiwa was reporting “Internal 500 error” and Sensu Log Message showed the following {“timestamp”:”2017-06-21T19:17:36.362831-0400″,”level”:”warn”,”message”:”transport connection error”,”reason”:”possible authentication failure. wrong credentials?”,”user”:”sensu”}   This magical line helped troubleshoot the issue. IPV6 Example ## /opt/sensu/embedded/bin/ruby -rresolv -e ‘puts Resolv.getaddress […]

Bulk delete messages and files on Slack

Install Install Pip Debian wget https://bootstrap.pypa.io/get-pip.py python get-pip.py Install from Pip: pip install slack-cleaner   Usage # Delete all messages from a channel slack-cleaner –token <TOKEN> –message –channel general –user “*” # Delete all messages from a private group slack-cleaner –token <TOKEN> –message –group hr –user “*” # Delete all messages from a direct message […]

Block updates of a specific package

If you wanting to block updates of a specific package you can use the command “apt-mark” to put a hold on the package. There are various techniques to disable/lock package from install, upgrade and remove in Debian Linux and its derivatives such as Ubuntu and Linux Mint. The command apt-mark will mark or unmark a […]

FreeIPA Server Setup

Introduction FreeIPA is an open-source security solution for Linux which provides account management and centralized authentication, similar to Microsoft’s Active Directory. FreeIPA is built on top of multiple open source projects including the 389 Directory Server, MIT Kerberos, and SSSD. FreeIPA has clients for CentOS 7, Fedora, and Ubuntu 14.04/16.04. These clients make it fairly […]

Increase ELK ElasticSearch Performance

Tip #1: Know Your Deployment Topology Before You Set Configs Loggly is running ES 0.90.13 with separate master and data nodes. We won’t be going into too much detail about that right now (look out for a subsequent post), other than to say that you need to determine your deployment topology in order to make […]

Finding UUID to Identify Partitions

Linux’s ext2/ext3 filesystem uses UUID UUID benefits As a sesonded UNIX admin I have to deal with various data storage technologies such as SAN, iSCSI, DAS, scsi disks volumes. Sometime you may need to move storage from one device to another and updating /etc/fstab can be pain in a$$. With UUID Linux kernel should automatically […]

Set Host name in rhel7

The hostnamectl tool is provided for administering the three separate classes of host names in use on a given system. View All the Host Names To view all the current host names, enter the following command: ~]$ hostnamectl status The status option is implied by default if no option is given.

apt-get-repository Command is Missing

Problem: apt-get-repository Command is Missing I was trying to install the latest version of git from the Ubuntu Git Maintainers Team and I needed to add a Personal Package Archive (PPA) to the Software Sources. But when I tried to do this, I got an error: sudo: add-apt-repository: command not found Solution: Install the software-properties-common […]

Find Largest files on Linux System

How do I find the largest top files and directories on a Linux or Unix like operating systems? Sometime it is necessary to find out what file(s) or directories are eating up all your disk space. Further, it may be necessary to find out it at the particular location such as /tmp or /var or […]

Installing Tripwire

Security is an incredibly complex problem when administering online servers. While it is possible to configure firewalls, fail2ban policies, secure services, and lock down applications, it is difficult to know for sure if you have effectively blocked every attack. A host-based intrusion detection system (HIDS), works by collecting details about your computer’s filesystem and configuration. […]

ElasticSearch Clustering setup

ElasticSearch is flexible and powerful open source, distributed real-time search and analytic engine. Using a simple set of APIs, it provides the ability for full-text search. Elastic search is freely available under the Apache 2 license, which provides most flexibility. This article will help you for configuring ElasticSearch Multi Node Cluster on CentOS, RHEL, Ubuntu […]

Lets look at CronTab

About crontab The crontab is a list of commands that you want to run on a regular schedule, and also the name of the command used to manage that list. crontab stands for “cron table,” because it uses the job scheduler cron to execute tasks;cron itself is named after “chronos,” the Greek word for time.

Setting up Postfix relay

There are many reasons why you would want to configure Postfix to send email using an external SMTP provider such as Google Apps (Gmail), Mandrill, SendGrid, Amazon SES, or any other SMTP server. One reason is to avoid getting your mail flagged as spam if your current server’s IP has been added to a spam […]

ASA Install GNS3

GNS3 team has done a great job in stabilizing the ASA implementation. On the new version1.2.1 they have already set all default options (kernel command and Qemu options) to the best possible set that is out there( which you see below). And they have also stabilized the cpu utilization issue with ASA by integrating cpulimit […]