gtalkbot 1.4

    Its been a while between gtalkbot releases, and that's mainly because the current version "just works" and no one has reported any bugs or feature requests. However, the other day I was running a lot of long lived commands, and started getting annoyed at not knowing when they were finished. I thought it would be nice to get sent an IM when a command had completed. So, I implemented that in this new release.

    There is a simple shell script called notify.sh, which you need to modify to have the right path for an outbox directory. This directory is watched by gtalkbot, and files in the directory are processed as part of the idle loop. The format for files in the directory is the jabber ID to send to on the first line, and then the message on the remaining lines. I guess that means you don't have to use the shell script at all if you want, just have something dump files in the magic directory.

    You then need to add this line to the gtalkbot config file:

      
      connectwith	myaccount@gmail.com
      
      password	mypassword
      
      pluginsdir	/data/src/gtalkbot/plugins
      
      outboxdir	/data/src/gtalkbot/outbox
      
      authfile	/data/src/.gtalkbot-passwd
      
      


    So, there you go. I now get IMs when commands are completed, by running them like this:

      
      $ longcommand; echo "long command done" | notify mikaljabber@gmail.com
      
      


    The source for gtalkbot 1.4 is here.

posted at: 17:25 | path: /gtalkbot | permanent link to this entry

    #1 Michael Still

    Although, it now occurs to me that I could just have added an idle() method to the plugin interface, and then written the directory watcher as a plugin. That would have been nicer in fact, and I may yet refactor the code that way.

    #2 Cafuego

    Of course, this means you can use it for nagios-jabber notifications too.

    #7 Paul

    Awesome job. Thank you.

    Since you mention it. :) Here are some feature requests:

    * permission based commands. UserA can run df and hostname, but UserB can only run df.
    * ability to adjust the verboseness(removing the idle output(why is it even there?) to no output at all)
    * better error messages. I still don't know what I changed to get this thing to work... the error message didn't say why it wasn't starting
    * passwords stored as hashes(should be easily accomplished looking at the code
    * ability to set display name, mybot rather than mybot@gmail.com
    * function to sanitize input, so options could be passed safely

    Its a start...

    #9 brass02

    I'm new to python. I was just curious as to how to make the password and config files and what to call them and what the file extensions are. and which folder to put these in.

    Add a comment to this post:

    Your name:

    Your email: Email me new comments on this post
      (Your email will not be published on this site, and will only be used to contact you directly with a reply to your comment if needed. Oh, and we'll use it to send you new comments on this post it you selected that checkbox.)


    Your website:

    Comments: