Skip to main content

Posts

Showing posts from April, 2017

Finding CPU consumers in linux for zabbix

I wrote a little script to grab the output of the linux  top -command into a Zabbix item, e. g. when zabbix reports high CPU load, what process may be causing it. My solution is not very sophisticated, but maybe somebody finds it useful, or feels like improving it. By now, it reports the names of top cpu-time-consuming processes, if their CPU% exceeds a given value. With small modifications and an adjusted  toprc  configuration, one could use it for RAM consumers or anything else top is able to report. Code: #!/bin/bash ##################################################### # topcpu.sh # returns names of most CPU time consuming processes # as reported by 'top' ##################################################### # 05-07-2010 by Jerry Lenk # Use at your own risk! ##################################################### # set limit to 1st argument, or 2% if not specified lim=$1 test -z $lim && lim=2 # run 2 iterations of top in batch mode with 1 s delay top -b -d

Zabbix template for collecting IO statistics

Zabbix template for collecting IO statistics With this template you can collect different disk statistics. Installation To install, copy  userparameter_diskstats.conf  to  /etc/zabbix/zabbix_agentd.d/userparameter_diskstats.conf  and  lld-disks.py  to  /usr/local/bin/lld-disks.py . Do not forget to mark it executable. # diskstats user parameters config sudo mkdir -p /etc/zabbix/zabbix_agentd.d/ sudo wget https://raw.githubusercontent.com/grundic/zabbix-disk-performance/master/userparameter_diskstats.conf -O /etc/zabbix/zabbix_agentd.d/userparameter_diskstats.conf # low level discovery script sudo wget https://raw.githubusercontent.com/grundic/zabbix-disk-performance/master/lld-disks.py -O /usr/local/bin/lld-disks.py sudo chmod +x /usr/local/bin/lld-disks.py userparameter_diskstats.conf  is user parameters for Zabbix.  lld-disks.py  is low level discovery script for enumerating disks of your system. After that restart zabbix-agent  sudo service zabbix-agent r

Monitoring Terminology and Metrics

Metrics Monitoring uses a variety of metrics to track system health. We will go through the different resources, the units used to measure them, and the way they can be used by CPM Monitoring.  CPU Utilization CPU utilization measures the amount of processor being used at a given time. CPU utilization is expressed as a percentage. On DigitalOcean, total use of all processors combined is indicated by 100%. This differs from some CPU usage tools which report 100% per CPU or core. For example, other tools might express metrics out of 200% on a machine with two CPUs, or 400% for a quad-core processor. In the Droplet graphs, CPU usage is broken down in terms of Linux's conception of system and user time. System time is time spent executing kernel-level instructions, while user time is time spent executing "userland" instructions, which is defined by anything outside of the kernel. Alert policies do not distinguish between user and system time. Memory Memory

How To Set Up a Firewall Using FirewallD on CentOS 7

Introduction Firewalld is a complete firewall solution available by default on CentOS 7 servers. In this guide, we will cover how to set up a firewall for your server and show you the basics of managing the firewall with the  firewall-cmd  administrative tool (if you'd rather use  iptables  with CentOS, follow  this guide ). Basic Concepts in Firewalld Before we begin talking about how to actually use the  firewall-cmd  utility to manage your firewall configuration, we should get familiar with a few basic concepts that the tool introduces. Zones The  firewalld  daemon manages groups of rules using entities called "zones". Zones are basically sets of rules dictating what traffic should be allowed depending on the level of trust you have in the networks your computer is connected to. Network interfaces are assigned a zone to dictate the behavior that the firewall should allow. For computers that might move between networks frequently (like laptops), th