SMB/samba uptime monitoring

I wanted to be able get a notification when a SMB/samba server went down so I set up a script on a FreeBSD server. This script will connect to a SMB share and check for the existence of a file/folder on that share.
If it does not exist then it will E-mail you. I put this in /home/username/bin
and it needs a tmp directory in /home/username/bin/tmp (or modify the script to use some other directory).
Configure the variables at the beginning for your use.

I named this file



#Note that this needs to be only the first word of the folder name (spaces not supported)

cd ~/bin

FOLDERCHECK=$( smbclient --user=$SMBUSERNAME -c "ls" \\\\$SERVERTOCHECK\\$SERVICETOCHECK $SMBPW 2>/dev/null | grep $FOLDERTOCHECK | cut -f 2 -w )

	#echo "Yep, $SERVERTOCHECK samba is up."

	if [ -e tmp/uptime-$SERVERTOCHECK-$SERVICETOCHECK-down ]; then
		#echo "Back up!"
		date | mail -s "Service Up: $SERVERTOCHECK-$SERVICETOCHECK samba" $NOTIFYEMAIL
	#echo "No, $SERVERTOCHECK samba is down!"
	if [ -e tmp/uptime-$SERVERTOCHECK-$SERVICETOCHECK-down ]; then
		#echo "still down..."
		touch tmp/uptime-$SERVERTOCHECK-$SERVICETOCHECK-down
		date | mail -s "Service Down: $SERVERTOCHECK-$SERVICETOCHECK samba" $NOTIFYEMAIL

In /etc/crontab I have this to check every 5 minutes:

*/5 * * * * username /home/username/bin/

PS The script would need to be modified to support spaces in any server names, etc.

3D Graphs

I am taking multivariable calculus and I wanted some 3D graph templates and I did not really like what I saw browsing around so I made a couple word documents. The markings are really close to 1/4″ and I have two versions. One has numbers up to ten and the other does not.

3D Graph with number labels, 0.25inch markings

3D Graph No numbers, 0.25inch markings

The files are bigger than they really need to be because I did not optimize the images much.

Mozilla Thunderbird Suggested Changes

I do not have the time to code right now, but if I had the time to tweak Mozilla Thunderbird, this is what I would do:

  • make more of a central cache for e-mails and e-mail content (perhaps instead of creating a bunch of msf files)
  • integrate certain plugins (LookOut, QuickFolders)
  • create a centrally managed version (maybe based on some sort of extended IMAP?) By this I mean what might be called a corporate version where everything is controlled on a central server.
  • Create a single-tasking mode (maybe based on reading list from QuickFolders extension)
  • Add a button to close and open folder pane
  • Do not show preview pane until an e-mail is clicked (ie hide it every time you click a folder)
  • Make sure connection can totally reset from within an e-mail draft without being trapped in a loop where you can no longer save draft and no longer send.

Fix the following bug (IMAP IDLE no longer works and has not worked for a while):

The related bugs (there are many) may say the problem is fixed but it is not. The issue boils down to the IDLE connection is closed right when the new mail message should arrive so Thunderbird does not say a new E-mail has arrived.