Skip to main content

Posts

Showing posts from December, 2015

PowerShell Script for Switching Between Multiple Windows

Windows PowerShell has strong capabilities. I have a separate computer with a big lcd screen in which I am watching regularly some web based monitoring applications. So I need those application windows switch between on a timely basis. Then I wrote this simple powershell script to achieve this. You can change it according to your needs.

Feeding Active Print Jobs to Graphite

It's pretty obvious that lots of print jobs are running on your cups server. In my case there are more than one cups servers running behind a load balancer. So tracking their active jobs will work for you to check if they spread across on the servers smoothly.
Schema definitions for Whisper files in the storage-schemas.conf are expressed:
[print_server_stats]
pattern = ^print_stats.*
retentions = 1m:7d,30m:2y
Two retention policies are defined. One for short term (samples are stored once every minute for seven days) and the other for long term (samples are stored once every thirty minute for two years).
Following bash script is used for sending active jobs count to graphite in every cups print server:


Once you create the script it can be started as a background job from a shell terminal:
# ./feed_graphite.sh >/dev/null 2>&1 &