ShinobiLayer: Process monitoring with Advanced Monitoring

Introduction

SoftLayer's Advanced Monitoring uses NimSoft. This article will show you how to set up process monitoring, which is often asked.

Confirm process name

Check the process name you want to monitor. Let's take mysqld as an example this time. To identify the process name, the ps command optionally uses -e instead of -ef.

# ps -ef | grep -e PID -e mysqld
UID        PID  PPID  C STIME TTY          TIME CMD
root      1591     1  0 14:29 pts/1    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql     1700  1591  0 14:29 pts/1    00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root      4042  3248  0 15:15 pts/2    00:00:00 grep -e PID -e mysqld

# ps -e | grep -e PID -e mysqld
  PID TTY          TIME CMD
 1591 pts/1    00:00:00 mysqld_safe
 1700 pts/1    00:00:00 mysqld

Settings in Customer Portal

Now, in case of failure, the following notification will be forwarded to the email. 005.jpg In addition to email, you can check the current failure from the screen below. 006.jpg

How to use Process Command Line

For example, when you want to monitor a specific shell, all process names in Linux are output as ** bash **, so it is indistinguishable. The ** Process Command Line ** is used when this distinction is required.

Let's look at a concrete example. The following is running bash /usr/local/hoge.sh, but ps -e makes the process name indistinguishable.

# ps -ef |grep -e PID -e "hoge.sh" | grep -v grep
UID        PID  PPID  C STIME TTY          TIME CMD
root      3928 22591  0 15:13 pts/0    00:00:00 bash /usr/local/hoge.sh


# ps -e | grep -e PID -e bash
  PID TTY          TIME CMD
  588 pts/1    00:00:00 bash
 3248 pts/2    00:00:00 bash
 3928 pts/0    00:00:00 bash
22591 pts/0    00:00:00 bash

In this case, as shown in the figure below

By setting, correct monitoring settings are possible.

Recommended Posts

ShinobiLayer: Process monitoring with Advanced Monitoring
Winning with Monitoring
Gaussian process with pymc3
Kill the process with sudo kill -9
[Python] Folder monitoring with watchdog
Monitor Tomcat process with Zabbix-agent
Process feedly xml with Python.
Authentication process with gRPC and Firebase Authentication
Process Pubmed .xml data with python
[For beginners] Process monitoring using cron