+ Post New Thread
Results 1 to 11 of 11
General Chat Thread, E-mail notifications for printer alerts in General; I'm not too sure where to stick this, so I'll put it here for the time being. Currently we have ...
  1. #1

    X-13's Avatar
    Join Date
    Jan 2011
    Location
    /dev/null
    Posts
    8,004
    Thank Post
    508
    Thanked 1,591 Times in 1,122 Posts
    Blog Entries
    19
    Rep Power
    700

    Question E-mail notifications for printer alerts

    I'm not too sure where to stick this, so I'll put it here for the time being.


    Currently we have 5 printer in the school. 1 connected via ethernet, the other 4 are wireless.

    The ethernet one has an option to set up e-mail alerts for low/no toner, paper jams, other malfunctions, but the others don't.


    Is there a way of setting them up to shoot off a message about errors?

    Bear in mind, we have no money. So buying something like papercut isn't really an option.

  2. #2

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    12,968
    Thank Post
    587
    Thanked 1,496 Times in 1,342 Posts
    Rep Power
    398
    Nagios or something similar to monitor them via snmp?

    Ben

  3. Thanks to plexer from:

    X-13 (6th July 2011)

  4. #3

    X-13's Avatar
    Join Date
    Jan 2011
    Location
    /dev/null
    Posts
    8,004
    Thank Post
    508
    Thanked 1,591 Times in 1,122 Posts
    Blog Entries
    19
    Rep Power
    700
    Ah, I should have mentioned... We don't host/control/provide/own the e-mail server.

    The LEA provide it. I'm still trying to actually get the settings for it so I can set up the ethernet printer.


    This may even be moot depending on the LEA's reply.


    One day... ONE DAY... I'll actually be allowed to do my job...

  5. #4
    Irazmus's Avatar
    Join Date
    Feb 2006
    Location
    Suffolk
    Posts
    307
    Thank Post
    11
    Thanked 15 Times in 13 Posts
    Rep Power
    20
    Another vote for Nagios.
    For 5 printers any old PC should do you, and you can get Nagios to alert you however you want. Ours alerts via e-Mail, SMS (via Twitter) and a display screen in the office.

  6. Thanks to Irazmus from:

    X-13 (6th July 2011)

  7. #5

    Join Date
    Oct 2005
    Posts
    768
    Thank Post
    49
    Thanked 99 Times in 89 Posts
    Rep Power
    61
    Quote Originally Posted by Irazmus View Post
    SMS (via Twitter)
    How does that work? Would you mind telling me more?

    Cheers!

  8. #6
    Irazmus's Avatar
    Join Date
    Feb 2006
    Location
    Suffolk
    Posts
    307
    Thank Post
    11
    Thanked 15 Times in 13 Posts
    Rep Power
    20
    You will need (at least) two Twitter accounts, one to post alerts to, and one (per person to be alerted) to follow the alert account. I keep the alert account's timeline private as I don't want to announce system issues to the world. You will also need to install Tweepy [ tweepy - Twitter API library for Python - Google Project Hosting ] and it's dependencies, Python 2.5+, Simplejson, Python-OAuth, python-memcached.

    Excuse me if I miss anything out, it's been years since I set this up.
    If memory serves, you will need to register a new application with Twitter. Register it online [ OAuth FAQ | dev.twitter.com ] then enter consumer secret and key in the variables below and run the first script.

    /usr/local/nagios/twitnag-authorize.py
    Code:
    #!/usr/bin/env python                                                                                                                                  
    
    import tweepy
    
    CONSUMER_KEY = ''
    CONSUMER_SECRET = ''
    
    auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
    auth_url = auth.get_authorization_url()
    print 'Please authorize: ' + auth_url
    verifier = raw_input('PIN: ').strip()
    auth.get_access_token(verifier)
    print "ACCESS_KEY = '%s'" % auth.access_token.key
    print "ACCESS_SECRET = '%s'" % auth.access_token.secret
    Take the access secret and key produced by this script and add them, along with the consumer secret and key, into the second script, and update the proxy details as needed.

    /usr/local/nagios/twitnag.py
    Code:
    #!/usr/bin/env python                                                                                                                                  
    
    import sys
    import tweepy
    
    CONSUMER_KEY = ''
    CONSUMER_SECRET = ''
    ACCESS_KEY = ''
    ACCESS_SECRET = ''
    
    auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
    auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
    api = tweepy.API(auth, proxy_host="proxy.county.org.uk", proxy_port="8080")
    api.update_status(sys.argv[1])
    Then create two new definitions in your Nagios config.

    /usr/local/nagios/etc/objects/commands.cfg
    Code:
    define command{
    	command_name notify-host-by-twitter
    	command_line /usr/bin/python /usr/local/nagios/twitnag.py "$NOTIFICATIONTYPE$ - $HOSTNAME$-$SERVICEDESC$ - $SERVICESTATE$ - $SERVICEOUTPUT$"       
    	}
    
    define command{
    	command_name notify-service-by-twitter
    	command_line /usr/bin/python /usr/local/nagios/twitnag.py "$NOTIFICATIONTYPE$ - $HOSTNAME$-$SERVICEDESC$ - $SERVICESTATE$ - $SERVICEOUTPUT$"
    	}
    Add the new commands to your contact definition(s).

    /usr/local/nagios/etc/objects/contacts.cfg
    Code:
    service_notification_commands   notify-service-by-email notify-service-by-twitter    ; send service notifications via email and twitter
    host_notification_commands      notify-host-by-email notify-host-by-twitter          ; send host notifications via email and twitter
    Now restart Nagios and any system alerts are sent to Twitter, and you can use their SMS gateway to receive alerts without paying*

    * Assuming you're on a supported mobile network.

  9. 2 Thanks to Irazmus:

    ChrisH (6th July 2011), X-13 (6th July 2011)

  10. #7

    Join Date
    Oct 2005
    Posts
    768
    Thank Post
    49
    Thanked 99 Times in 89 Posts
    Rep Power
    61
    @Irazmus - Wow! Thanks... that's absolutely brill! :-)

  11. #8

    Join Date
    Jan 2011
    Location
    Bargoed, Caerphilly
    Posts
    13
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    I'd suggest using HP Web JetAdmin which gives you total management over your Printers (HP and Non HP). You can configure all the alerts you need. HP Web Jetadmin software

  12. #9
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,938
    Thank Post
    114
    Thanked 272 Times in 250 Posts
    Rep Power
    104
    @Irazmus do you know of any way to get the proxy to work under Windows? I have a few things I could use this for. I got it working how I wanted at home but it doesn't seem to recognise the proxy settings under Windows as from what I can tell, they are Linux env vars.

  13. #10
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,938
    Thank Post
    114
    Thanked 272 Times in 250 Posts
    Rep Power
    104
    Hmm couldn't get it to work under Linux either same error.

  14. #11
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,938
    Thank Post
    114
    Thanked 272 Times in 250 Posts
    Rep Power
    104
    I gave up with that in the end and managed to get a perl script called nitter2 to work under Linux at least. I would like to know if anyone has success with tweepy though.

SHARE:
+ Post New Thread

Similar Threads

  1. PaperCut Notifications
    By markesmith in forum Network and Classroom Management
    Replies: 8
    Last Post: 8th February 2013, 07:47 PM
  2. [MS Office - 2007] Outlook notifications
    By RabbieBurns in forum Office Software
    Replies: 4
    Last Post: 5th February 2009, 10:43 AM
  3. PureMessage Alerts
    By atfnet in forum How do you do....it?
    Replies: 3
    Last Post: 30th April 2008, 11:14 AM
  4. [CLOSED] Bug/Error: E-mail Notifications
    By FN-GM in forum EduGeek.net Site Problems
    Replies: 10
    Last Post: 18th January 2008, 05:30 PM
  5. Sophos Notifications
    By k-mart in forum Wireless Networks
    Replies: 2
    Last Post: 20th December 2006, 03:28 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •