Skip to main content

Server keeps going down, don't know why

Comments

3 comments

  • damian-d
    I should also say that when the server is rebooted it stays up for a few hours or a couple of days, but it just drops again. but always without warning.
    0
  • NOC_Serverpoint
    Hi, It is best suggested to setup a monitoring script to sent you alert emails if the server load increases.
    =================================== #!/bin/bash ;We set a trigger for how high the load can get before we're ;alerted via e-mail from this script. trigger=4.00 ;We set a load variable to read the current server load from ;/proc/loadavg and only from the first column which is the live load. load=`cat /proc/loadavg | awk '{print $1}'` ;We set a response variable to the word "greater" if the current ;load is greater than our trigger that we set. response=`echo | awk -v T=$trigger -v L=$load 'BEGIN{if ( L > T){ print "greater"}}'` ;If the response is set to "greater" we run the sar -q command ;and pipe | that data to the mail command for recipient@example.com ;this sends an e-mail with the server's recent load averages there. if [[ $response = "greater" ]] then sar -q | mail -s"High load on server - [ $load ]" recipient@example.com fi ===================================
    And setup a cron job for this bash script to run periodically. */5 * * * * bash "script location" Hope this helps to identify the issue.
    0
  • cPanelMichael
    Hello, The /var/log/messages and /var/log/dmesg log files are useful logs to review when attempting to determine why a system is rebooting. You may also want to consult with your data center to verify no hardware issues are resulting in the reboots. Thank you.
    0

Please sign in to leave a comment.