Nov 232017
 

I bought a pair of cheap USB headphones yesterday so I could test out whether my sound issue on my computer was due to my sound card, or another issue.

The issue I after plugging them in however, was that I could not easily switch the sound output to the USB headphones.
I don’t run pulseaudio, so I was left with playing with configuration files to try and switch the audio over.

If I had been running pulseaudio, I’m sure this blog post would have been much shorter!
Continue reading »

Share
Mar 022017
 

I was poking around in a Swann NVR to see whether I could customise it to suit my needs a bit better.
The NVR was easy enough to pull apart with only 5 screws on the outside holding the case on.
Continue reading »

Share
Jan 202016
 

My home Zabbix instance was running out of space today, so I had to resize the partition that it lived on so that it would last a few more days while I worked out how to migrate it from my VMWare host to my ProxMox host.

Continue reading »

Share
Jun 182015
 

I recently had to verify a whole bunch of servers were responding to SNMP and had the correct DNS reverse look ups in Active Directory.
I used this little script so that it would ask me for an IP address and then do a ping, and then if a server was reachable over ICMP, a nslookup if a server responded to the SNMP Query for the system name.
Continue reading »

Share
Apr 132012
 

Hey Everyone

I have just finished making my very first bash script. It’s called Simple Log File Monitor as you may have guessed.
It reads in a log file, either from the beginning or from a mark that the script has set before, then it can perform a user defined action to the output of the log file after it has been read.
It will then apply an action to the resultant output of the logfile, e.g. email it to you.

I have written it in shell script in order for it to be small, and as reliant on as little as possible.
You should be able to run this script with just bash, awk, grep, tail, date, and wc.
The purpose of this was for a router that I plan to build. I didn’t want to install perl onto it as it will have miniscule storage, so I thought this was a better option. This script should also work on any embedded devices that have the required utilities installed, so if there is anyone out there who has one of those, I’d appreciate any testing that could be done on those devices.

This script allows you to set a configuration file with the -c switch when you run the script, but if you don’t set it, the script will use the default slfm.conf that should be located in the same directory as the script itself.

This allows you to customise when the log file is monitored, and which files are monitored by running the script at certain intervals with different command line parameters.
So the script will show the last hours worth of logs if the script is run hourly.

The script will mark it’s position so that it won’t have to read the whole entire logfile again, and then it can redirect the output of the logfile to anywhere. For example it can email you the results, or it can append the results to a file.

The documentation on this isn’t great at the moment so any help with that would be appreciated.
If anyone could please try this script out and provide feedback in the comments section, that would be great.
As this is my first script, please be gentle πŸ˜€ but I’m open to any suggestions on how to make this better.

This script can be downloaded from my sourceforge page.
It has a sample configuration file already included to help you get started. Hopefully it’s understandable enough and clear enough to everyone and easy enough to work with.
Hope to hear back from some new users πŸ˜€

Share