Create a Post
Showing results for 
Search instead for 
Did you mean: 

Script to check health on SMB

Hello SMB Admins!

I am writing a script that is checking some key SMB sensors and sending e-mail should any of them goes outside pre-define thresholds.

It is currently evaluating:

- Cooling fan speed
- CPU temperature
- Motherboard temperature
- Amount of free OS memory
- Free disk space on /storage, /logs and /pfrm2.0 volumes
- Load average (1 min)

- Voltage readings 

- Core dump 

- ICMP probes

The script is written in LUA which is very light and fast embedded script language. You can review it with any text editor.

It currently works on 14x0 appliances only.

If you want to try it:

1. Copy the attached two files to the appliance. You may put them in /logs/smb_health_check/ so that they are not deleted on firmware upgrade. Or anywhere else, doesn't matter.

2. Using vi, edit smb_health_check.cfg. Set as a minimum, e-mail sender and recipient and IP of your mail server (which must be accessible from the appliance of course).

3. You may check pre-defined thresholds for the different sensors and adjust them as needed for your environment. 

4. Test-run the script:

   expert# chmod 700 smb_check_health.lua
   expert# ./smb_health_check.lua

5. If you like, run it as a cron job every 5 minutes or so.

Careful with the comma's in the config file or script will fail Smiley Happy

Questions or suggestions are welcome. Mind that I am still working on it so not everything is polished yet.

1 Reply

If you are going to place that script in crontab you will need to do it again after firmware upgrade because crontab will be reset. Keep that in mind.