March 2017
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

March 2017
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Monit process

# mysql check process mysqld with pidfile /var/lib/mysql/ns388683.pid group database start program = “/etc/init.d/mysql start” stop program = “/etc/init.d/mysql stop” if failed host 127.0.0.1 port 3306 then restart if 5 restarts within 5 cycles then timeout # nginx check process nginx with pidfile /opt/nginx/logs/nginx.pid start program = “/etc/init.d/nginx start” stop program = “/etc/init.d/nginx stop” […]

MonitSMS

Create a new file named MonitSMS.sh in your /root directory (or wherever you prefer – i use root because I manage many different type of OS) and paste the following code:

#!/bin/sh /usr/bin/curl \ -X POST http://textbelt.com/text \ -d number=1111111111 \ -d “message=[$MONIT_HOST] $MONIT_SERVICE – $MONIT_DESCRIPTION”

Change 1111111111 to your cell/mobile phone number. Give it […]

useradd Not copying any file from skel directory into it.

Useradd in Linux – Not copying any file from skel directory into it useradd: warning: the home directory already exists. Not copying any file from skel directory into it.

If the directory didn’t exist , the Linux useradd process creates the directory and copies the skel files : .kshrc , .bashrc , .bash_profile and .bash_logout […]