SoftLayer's Advanced Monitoring uses NimSoft. This article will show you how to set up process monitoring, which is often asked.
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
Go to Devices-> Monitoring. Select ** Configure Agent Reports ** in the ** Advanced ** field of the relevant server
Select ** Process Monitoring Agents ** as Agents. In Sections, select ** Alarm Subscribers ** and add notification destinations by email.
Select ** Add Agent Config ** in Profiles and configure the process to detect. ** Note that the process name is "mysqld" instead of "/ usr / libexec / mysqld"! ** In the following, ** Watcher Name ** and ** Process ** have the same name for the sake of clarity. Finally, select ** Add Agent Config ** at the end and you're done.
Now, in case of failure, the following notification will be forwarded to the email. In addition to email, you can check the current failure from the screen below.
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