Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Monitoring services are running properly and will email alert     - Linux system security configuration Collection (Linux)

- Compiled version of Android Opus audio codec library method (Programming)

- command-line tool for send e-mail (Linux)

- Java multi-threaded shared communications variables (Programming)

- Android Studio Personalization (Linux)

- E: Sub-process / usr / bin / dpkg returned an error code (1) error solution (Linux)

- ApacheDS configuration of users and user groups to achieve SSO (Server)

- Linux Thread Synchronization (Programming)

- Using Libreoffice under ubuntu (Linux)

- Use Ganglia to monitor your cluster (Server)

- df show disk space usage (Linux)

- Install the free open source financial software GnuCash 2.6.6 under Ubuntu (Linux)

- CentOS 6.4 under PXE + Kickstart unattended operating system installation (Programming)

- To install Ganglia configuration of experience under CentOS 5.5 (Linux)

- How to upgrade Docker 1.6 on Fedora / CentOS (Server)

- Linux environment variable configuration and save places (Linux)

- The free command in Linux (Linux)

- CentOS7 compile and install Tengine + PHP + MariaDB notes (Server)

- To use slay kill user processes (Linux)

- Build your own Web server under Ubuntu Linux system (Server)

 
         
  Monitoring services are running properly and will email alert
     
  Add Date : 2018-11-21      
         
         
         
  Monitoring service, which is placed in crontab task, individuals do not like to use an infinite loop in the background.

So each will perform three cycles, three consecutive cycles, the service is down for any of these, it will alarm.

Small universal knowledge, redirected attention to three kinds of writing, in fact, the effect is the same.

#! / Bin / bash
  
nmap -p 6065 10.31.6.6 | egrep "6065 / tcp open" &> / dev / null
code1 = $?
  
nmap -p 80 10.31.6.6 | grep "80 / tcp open http"> / dev / null 2> & 1
code2 = $?
  
curl http://10.31.6.6/test.html/> & / dev / null
code3 = $?
  
my_mail () {
  
mail_list = ( "test@hotmail.com" "test2@hotmail.com")
now_date = `date" +% Y-% m-% d% T "`
for i in $ {mail_list [@]}
do
echo -e "webchat is down, please check; \ nip: 42.62.5.100 \ n $ now_date" | mail -s "webchat down" $ i
done
}
  
n = 1
count = 1
while ((n < 4))
do
  
if [$ code1 = 0] && [$ code2 = 0] && [$ code3 = 0]
then
  n = $ (($ n + 1))
  sleep 2
  
else
  count = $ (($ count + 1))
  n = $ (($ n + 1))
  sleep 2
  if [$ count -eq 3]; then
   my_mail
  fi
          
fi
  
done
     
         
         
         
  More:      
 
- Java thread lifecycle (Programming)
- Java 8 Lambda principle analysis (Programming)
- MySQL group_con cat_max_Len (Database)
- Java foundation comb: Array (Programming)
- Using RAID in Linux: Create a RAID 5 (Linux)
- ORA-12545: Connection failed because the target host or object does not exist (Database)
- Explore Android SQLite3 multithreading (Programming)
- See Shell Script Linux Server network traffic (Server)
- Linux C source code (Ascii HexToBinary: Converts hexadecimal string format ASCII codes) (Programming)
- Raspberry Pi configuration wireless hotspot (Linux)
- 10 practical Java programming technology (Programming)
- Under Ubuntu 15.04 installation JDK8 (Linux)
- Linux system installation Gitlab (Server)
- Mistakenly deleted redo log file group being given the lead to start the database ORA-03113 (Database)
- Loop arrays in C language is not easy to find a bug (Programming)
- Hadoop safe hftp (Server)
- Java rewrite the hashcode method (Programming)
- After you change the GRUB boot disk partition repair (Linux)
- Configuring a Linux operating system security management services (Linux)
- Linux shared libraries .so file name and Dynamic Link (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.