Search

websec: monitor websites for changes

December 30th, 2006 edited by ana

Entry submitted by Lucas Nussbaum. DPOTD needs your help, please contribute !

A lot of websites don’t provide RSS feeds yet. When you want to monitor changes to such sites, you can only visit it from time to time, or use public services such as FEED43 or RSSPECT. Websec (Web Secretary) automates the process of regularly visiting the website: it typically runs in a cron job, and compares the content of a web page with what it fetched during the previous run. If the content has changed, it will email it to you with the changed content highlighted.

It works quite well, but has some limitations:

  • You cannot monitor a whole website, but only single web pages ;
  • You can exclude some text from the comparison (typically “Generated in 0.2s”, the current date/time, etc), but I couldn’t get it to exclude multi-line expressions (this makes it impossible to monitor Google results, for example). See bug #402113.

I couldn’t find a package doing the same as websec, but generating an RSS feed instead instead of emailing the changes. If someone want to write one, it might be possible to re-use some of websec’s code.

You can find websec’s homepage at http://baruch.ev-en.org/proj/websec/

Websec has been available in Debian and Ubuntu for several stable releases, and doesn’t suffer from any really annoying bug.

Posted in Debian, Ubuntu | 2 Comments »

scli: a collection of SNMP command line management tools

December 27th, 2006 edited by pipitas

Entry submitted by Kurt Pfeifle. DPOTD needs your help, please contribute !

Some common daily problems for IT people….

  • You are installing a Laserjet driver for the brandnew Lexmark printer your boss bought, but you do not know: was the darn thing shipped with a PostScript module installed or does it understand PCL only?
  • You are wondering, what the LCD display of the printer down the hall currently indicates, but you’re too busy to get up and walk down?
  • You are bothered by a user who phones “My big HP jammed; though I removed the paper, this red light keeps blinking all the time!”?

Use scli.

scli is the command to invoke the “SNMP Command Line Interface”. A little known console utility, it is of great use to me on many occasions.

Executive summary:

scli connects to any SNMP-enabled network node and lets you interactively “browse” through the values stored in the device’s SNMP database (”MIB”, Management Information Base). My own personal usage is mainly for network printers (yeah, that’s why I picked these examples), but scli can work with many more device types: bridges, routers, gateways, switches, computers and more. (And it also has a scriptable, non-interactive mode).

Target users:

  • users who want to learn what kind of info the devices owned by them do reveal to their network neighbourhood
  • users who are executing a kind of “remote helpdesk” function (in their job, for their friends, or within their own family)
  • users who are just curious about SNMP functions, and want to learn about that resource and about their network nodes
  • users who are somewhat familiar with “snmpwalk”, but not familiar enough to run it without consulting the manpage every time again)

Links:

Glorious details for the curious:

scli does not only give you a more user friendly way than snmpwalk to run SNMP queries, it also formats the results it returns in a more user friendly way. You can run scli interactively (which gives you its own shell+prompt to run different commands) or in a way that just executes one command, displays the result and returns to your standard shell (this mode is also good for scripting stuff).

By default, scli returns plain ASCII text messages. But you can also tell it to return XML by using the “–xml” parameter. (XML may be useful if you want the return to be processed by software, instead of being read by a human).

Assuming the network node you are interested in poking at has the IP address 192.168.23.45. Start the tool by typing

  scli 192.168.23.45

SNMP-enabled devices by default use “public” as their “community name”, and if scli does not see a community name on the commandline, it tries to use “public”.

You wonder what that community name” thingie means? It is a very weak way of authorization; in essence, a password common to all users, but no separate user names. SNMP in version 1 will not even encrypt the community name on the wire! Yes, that’s very bad security for most devices, but that’s how the real life SNMP world around us currently is. (SNMP v2 and v4 are better, but not yet as common in devices used out there).

If you have a less open node, and you happen to know the used “community name”, use it as an additional argument:

  scli 192.168.23.45 "community-name"

If it succeeds connecting, scli will present you its prompt:

  scli > 

It is in interactive mode now. Type “help” to see the available commands. Type “show system info” to find out who the vendor of the device was, and what the model name is. I’m sure you will find more interesting queries of your own quickly.

scli has a good commandline auto-completion (using the [TAB] key) built in. Type “show system [TAB] [TAB]“ to get a list of subcommands other than the “info” we used. You’ll see possible completions “devices info mounts processes storage”. That means “show system storage” is another valid scli full command. Try it.

Of course, you can even try “show system” on its own [without any of the available sub commands]. That makes scli execute all of these subcommands and return all results at once (but piped through a pager).

The same is true for “show [TAB] [TAB]“ or “show” all on its own. Run it and see all SNMP info about of device you are currently accessing.

A few tips will help you get up to speed with scli:

  1. Your most important command to remember with scli is “show scli command [TAB] [TAB]“.
  2. Your most frequently used initial command with scli will probably be “show scli command tree”.
  3. scli ships with a very good man page; make sure to look at it at least one time.
  4. scli can return its qurey results XML-formated, if called with the “–xml” parameter.

scli is available in Debian (stable, testing and unstable all have 0.2.12-2, while experimental has 0.3.0-0.1). If you happen to use 0.3.0, don’t miss to try a scan for SNMP enabled devices in your neighbourhood. At the interactive scli command prompt (scli >), type “run scli scan <a-network-IP-address-in-your-reach>”. Or run scli in command mode from the shell, and type: “scli -c ‘run scli scan <a-network-IP-address-in-your-reach>’” (that network address may be something like 192.168.0.0/24 or 10.162.4.0/22). This scan command is one of the new ones in 0.3; it will present you a list of all SNMP-enabled nodes that respond to the (unsafe) community name “public” (which we didn’t explicitely need to type here). You may want to fix that hole…

scli was created by Prof. Juergen Schoenwaelder, who also is one of the people who created the SNMP standard and wrote the RFCs describing it.


P.S.: Oh, you *really* wanted to know the answers to these initial questions? Ok, here we go:

Is my new Laserjet PostScript-enabled?
kurt:~> scli 192.168.23.45 -c "show printer interpreters" | grep Description
Description:   Lexmark PCL
Description:   Lexmark PostScript
Description:   Lexmark XL
Description:   Lexmark PJL
Description:   Lexmark Automatic Language Switching
Description:   Lexmark NPAP

So, whatever “NPAP” is — PostScript is supported as well. It will be easy to print to it from CUPS…
 
 

What’s on the LCD display on that remote printer right now?
kurt:~> scli 192.168.23.45 -c "show printer display"
PRINTER LINE   TEXT
      1    1   No Paper: Tray 4

Uuhh, and you wondered why that thing didn’t give any noise since 2 hours…
 
 

Why doesn’t that red light stop flashing on that printer?
kurt:~> scli 192.168.23.45 -c "show printer covers"
Printer:      1
Cover:        1
Description:  Rear Door
Status:       coverOpen

Printer:      1
Cover:        2
Description:  Top Door
Status:       coverClosed

So, that’s easy. Tell your user: “Please shut that darn Rear Door again and the flashing red light will go away.”



Posted in Debian, Ubuntu | 9 Comments »

unison: decentralized synchronization of files

December 24th, 2006 edited by lucas

Entry submitted by Gael Varoquaux. DPOTD needs your help. If you want it to continue in 2007, please contribute !

Unison allows to synchronize files between two or more computers. Unison does not require a dedicated server, or root privilege, it is able to run using ssh, or a direct socket connection. Transfers are optimised using a version of the rsync protocol.

Unison works by taking a footprint of the replicas at each synchronization, and using this footprint to find out which files changed between two synchronizations. Unison has no central repository, and you can synchronize replicas between an arbitrary number of computers, or even use an external storage as an intermediate replica to synchronize two computers with no network connection. It will detect conflicts between updates and signal them. Unison also garanties that a network or power failure will not lead to loss of data.

Links :

unison is available in Debian stable at version 2.9.1, testing and unstable both have 2.13.16. The latest Ubuntu release, 6.10/Edgy, the LTS release (6.06/Dapper) and the development version (Feisty) currently have version 2.13.16. The latest version upstream is currently 2.13.16 and the program is actively maintained, but no longer developed.

There also is a unison-gtk package, which brings a nice graphical front-end to unison:

Unison GTK

Posted in Debian, Ubuntu | 2 Comments »

qalculate: the ultimate desktop calculator

December 19th, 2006 edited by lucas

Entry submitted by Diwaker Gupta. DPOTD needs your help, please contribute !

Qalculate’s tagline says “the ultimate desktop calculator”. Though this might sound a little obnoxious, Qalculate lives up to its claims.

So what is qalculate? First and foremost, its a calculator. Which means that it can do what you typically expect a calculator to do, no surprises there. Here’s a screenshot of the main window.

There’s a convenient history window as well, and a handy keypad if you should need it.

But one rarely needs to use the keypad because another great thing about qalculate is the input mechanism – it is extremely smart, context sensitive and natural language oriented. So converting 50 kgs to lbs is as simple as typing “50 kgs to lbs”! And if you don’t know how to represent a unit (pounds or lbs), not to worry, qalculate will provide completion options as you go along:

And then qalculate can be used to do a lot of other things: simplify algebraic expressions, solve equations, a plethora of banking related functions (compute accrued interest etc), unit conversion, some basic plotting (via Gnuplot) and a lot of geometry related functions. Note that the Qalculate user interface has been implemented both in Qt and GTK, and so it will fit right into your desktop whether you are using KDE or GNOME.

Check out the full feature list, and also take a look at some of the screenshots.

qalculate is available in Debian sarge (v. 0.7.2). Version 0.9.x is also available in Debian testing/unstable, and Ubuntu since Dapper. And there are no open open bugs!

Posted in Debian, Ubuntu | 3 Comments »

htop: powerful top replacement

December 17th, 2006 edited by lucas

Entry submitted by Kristoffer Lundén. DPOTD needs your help. If you want it to continue in 2007, please contribute !

htop is a very competent interactive process viewer for the shell, providing all the functionality - and more - that the top utility does, in an easier and more intuitive way. htop provides easy-to-use menus for most operations and also has support for using a mouse.

In short, htop is an easier to use and friendlier version of top. While it hasn’t as much time behind it and therefore is less tested, it seems to work very well both locally and over SSH, and it’s well worth taking it for a spin. It’s just one of those small utilities that makes life a bit easier.

Target usages:

  • Users who don’t want to memorize or constantly look up keyboard shortcuts for top.
  • Users who want a clean and friendly interface to view and manage processes in the shell.

Links:

htop is available in Debian stable at version 0.5.1-1, testing and unstable both has 0.6.3-1. Latest Ubuntu release, 6.10/Edgy has 0.6.2-1, while the LTS release (6.06/Dapper) has 0.6-1. The development version (Feisty) currently has version 0.6.3-1. The latest version upstream is currently 0.6.5 and the program is actively maintained.

htop was created by Hisham Muhammad, who is also one of the developers for Gobolinux. Other contributors to the program are listed on the homepage.

Posted in Debian, Ubuntu | 7 Comments »

« Previous Entries