Accounts e-mail HP

Automatic hardware probe

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.

Automatic hardware probe

Postby Davide » Mon Jul 01, 2013 12:56 am

To stand one step ahead from hardware failures, I wrote a hardware tester script which probes the server each week and sends email alerts.

It's basic simple and uses the GCC compiler to detect segfaults; in my experience there's no better tool than GCC to probe hardware. Memtest86, Cpuburn, Memtester - you name the tool, I say it didn't work for me at least once, whilst the most latent and asymptomatic hardware failure always causes a segfault to GCC and of course also other undetected data corruption to the regular services.

GCC simultaneously tests the hard drive, IDE buses, RAMs, motherboard, CPU and power supply, while specific tools mostly test one single component at a time and so are unable to detect combined problems; for example, if the power supply is slightly undersized and unable to provide enough power to run the system on full load but seems adequate to run on moderate load, a specific tester tool won't detect that, as it would merely overload one single component.

Script:

Code: Select all
#!/bin/bash
# Complete computer hardware test with email report.

# Require: heirloom-mailx to send email notifications;
#          make;

email=baldiniebaldini@gmail.com

basedir=$(dirname "$0")
cd "$basedir"

: >log
cd ./linux
if { nice -n 19 make clean &&
     nice -n 19 make &&
     nice -n 19 make clean
   } >../log 2>&1                                   
then
    # success
    mail -s "Hardware test success" -r "Greatturn_Hardware_Tester" "$email" <<-EOF
        Periodic hardware tester running on server succeeded the GCC compilation test.
        EOF
else
    # fail
    mail -s "Possible hardware failure" -r "Greatturn_Hardware_Tester" "$email" <<-EOF
        Periodic hardware tester running on server failed the GCC compilation test.

        Latest output from compilation (stdout, stderr):
        $(tail -n100 ../log)
        EOF
fi
User avatar
Davide
 
Posts: 864
Joined: Sat Mar 24, 2012 12:34 am

Re: Automatic hardware probe

Postby Major Nimrod » Tue Jul 02, 2013 6:03 pm

Impact on CPU and useability ? Scheduled to run at opposite end of peak times ?
"Big Brother is watching you" - George Orwell
"Shh! I'm Hunting Wabbits" - Elmer Fudd
"What a Nimrod" - Bugs Bunny

NIMMY
User avatar
Major Nimrod
Contributor & Co-Admin
 
Posts: 505
Joined: Thu Dec 13, 2012 5:24 pm
Location: Montreal, Canada

Re: Automatic hardware probe

Postby Davide » Tue Jul 02, 2013 6:22 pm

Scheduled at 5:00 UTC of each Monday. Lowest peak of users there.
User avatar
Davide
 
Posts: 864
Joined: Sat Mar 24, 2012 12:34 am


Return to General discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron