ENABLING BEACONS IN SALTSTACK

ENABLING BEACONS IN SALTSTACK

In this post we are going to pursue how to enabling beacons in saltstack, Through the beacons we are going to monitor the servers(minions) services and disk usages, The beacon system allows the minion to hook into a variety of system processes and continually monitor these processes. Beacons Beacon Modules

Server and IP information:

OS Description: Ubuntu 16.04.2 LTS

Saltmaster: 192.168.232.70

host1: 192.168.232.71

host2: 192.168.232.72

we have created the highstate file to install the nginx service and create the index.html file.

check the output of below File: /srv/salt/top.sls, /srv/salt/webserver/nginx.sls, /srv/salt/webserver/templates/index.html.tmpl

enabling beacons in saltstack

enabling beacons in saltstack

enabling beacons in saltstack

INSTALLING SALT-MINION:

# curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com ; sh bootstrap-salt.sh -A 192.168.232.70 -i host1

Output of the above command:

Host1:

enabling beacons in saltstack

Host2:

enabling beacons in saltstack

Now the minions will sent their keys to Salt-Master and we need to accept the minion keys.

Salt-Master:

enabling beacons in saltstack

enabling beacons in saltstack

INSTALLING NGINX:

We have already create the highstate to install the nginx package and the index.html file, so we can call the file from minions via # salt-call state.highstate

Host1:

enabling beacons in saltstack

enabling beacons in saltstack

Host2:

enabling beacons in saltstack

enabling beacons in saltstack

DEPLOYING BEACONS:

# salt ‘*’ pkg.install python-pyinotify

enabling beacons in saltstack

# salt ‘*’ pkg.install python-psutil

enabling beacons in saltstack

If you receive the output like the above image then kindly make sure the package already installed in minions.

clip_image018

ADDING BEACONS (Nginx and Disk usage):

FILE: /srv/pillar/top.sls,

base:

‘*’:

– webserver.beacons

enabling beacons in saltstack

FILE: /srv/pillar/webserver/beacons.sls

beacons:

service:

nginx:

onchangeonly: True

diskusage:

– /: 80%

– interval: 60

enabling beacons in saltstack

# salt ‘*’ saltutil.refresh_pillar  # salt ‘*’ beacons.list   # salt ‘*’ cmd.run ‘systemctl restart salt-minion’

enabling beacons in saltstack

enabling beacons in saltstack

enabling beacons in saltstack

# systemctl restart salt-master.service

clip_image025

We can see the beacons alert on the event bus through below command, run it on salt-master.

# salt-run state.event pretty=True

Events:

Service Monitoring(If nginx service down):

enabling beacons in saltstack

when nginx service back online:

enabling beacons in saltstack

Disk Usage Monitoring:

enabling beacons in saltstack

We have set the threshold ‘80%’ for ‘/’ in /srv/pillar/webserver/beacons.sls

to increase the disk size we are using:

# dd if=/dev/zero of=/tmp/bigfile2 bs=1M count=2000

enabling beacons in saltstack

We can see the disk-usage message in the event bus whenever the limit exceeds the threshold. Same way we can use ‘inotify:’ beacon to monitor a file for changes.

Video:

Thanks!!

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts
zfs pool usage

ZFS Pool and Dataset Usage

ZFS Pool and Dataset Usage   I am back with another blog to provide the useful script to the Freebsd users to determine the zpool

Assistanz Networks

Installing Zabbix Agent in FreeBSD 12.0

Zabbix Agent Installation and Configuration Guide on FreeBSD 12.0   Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support