+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 26
Wireless Networks Thread, Monitoring Printers with Nagios in Technical; I'm using nagios to monitor my network and i want to add the network printers to it. They are mostly ...
  1. #1

    Join Date
    Jan 2007
    Location
    Birmingham
    Posts
    807
    Thank Post
    29
    Thanked 36 Times in 24 Posts
    Rep Power
    26

    Monitoring Printers with Nagios

    I'm using nagios to monitor my network and i want to add the network printers to it. They are mostly HP 2600N's. I've manged to find the OID for the maximum amount of toner, and the OID for the current amount of toner remaining. This is a little annoying as the maximum (M) is 470, the current (C) is 38. These values dont really imply much. I would prefer to do a quick calculation i.e. (C/M)*100 to get the percentage remaining. Any body got any ideas on how to do the calculations?

    Thanks in advance

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Isn't using 'check_printer' and/or 'check_hpjd' sufficient for you?

  3. #3

    Join Date
    Jan 2007
    Location
    Birmingham
    Posts
    807
    Thank Post
    29
    Thanked 36 Times in 24 Posts
    Rep Power
    26
    Thanks Geoff,

    Could have put money on you being first to respond!

    I've looked at check_hpjd and it's great for telling me the status i.e. on the one i've set it up on at the moment it says " Toner Low ("Ready") " the problem being it doesnt say which toner is low. Unless i'm missing some vital arguments which is always possible / likely.

    Lee

  4. #4

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,590
    Thank Post
    109
    Thanked 762 Times in 593 Posts
    Rep Power
    180
    I think that you need to write your own plugin if you want to be more specific - or you might find what you are looking for on NagiosExchange if you are lucky.

  5. Thanks to Ric_ from:

    Lee_K_81 (6th May 2008)

  6. #5

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    This Cacti forum thread will help you out developing a plugin.

    Monitoring HP Printer Toner Levels

    At the moment, I just look at the printers web status page when I get a warning.

  7. Thanks to Geoff from:

    Lee_K_81 (6th May 2008)

  8. #6

    Join Date
    Jan 2007
    Location
    Birmingham
    Posts
    807
    Thank Post
    29
    Thanked 36 Times in 24 Posts
    Rep Power
    26
    Quote Originally Posted by Geoff View Post
    This Cacti forum thread will help you out developing a plugin.

    Monitoring HP Printer Toner Levels

    At the moment, I just look at the printers web status page when I get a warning.

    I'd found that, but it seems to be discussing milligrams of toner remaining, i'd like percentage. I think i may just have to stick with the milligrams or write my own plug in.

  9. #7

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Well you can work back to a percentage based on mg. Assuming you know the total mg (hint: it's written in the toner specs).

  10. #8

    Join Date
    Jan 2007
    Location
    Birmingham
    Posts
    807
    Thank Post
    29
    Thanked 36 Times in 24 Posts
    Rep Power
    26
    as i said, i can get the total capacity (470mg) and the current (38mg) but i want the percentage (8% i.e. (38/470)*100), i might just have to show the values as is.

  11. #9

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,590
    Thank Post
    109
    Thanked 762 Times in 593 Posts
    Rep Power
    180
    NagiosExchange: check_hp_verbrauch should be exactly what you want!

  12. Thanks to Ric_ from:

    Lee_K_81 (14th May 2008)

  13. #10

    Join Date
    Jan 2007
    Location
    Birmingham
    Posts
    807
    Thank Post
    29
    Thanked 36 Times in 24 Posts
    Rep Power
    26
    Thanks _Ric, that script looks like it will work brilliantly once i've got it working, which is why it's taken me so long to get back.

    One thing i'm having trouble with at the moment is calculating the percentage, see code below:

    Code:
    MAX=`snmpget -O Uvbqs -v 1 -c Public $host $oidmax
    REST=`snmpget -O Uvbqs -v 1 -c Public $host $oidcur
    HUNDRED=100
    
    CURRENT=`expr $MAX - $REST`
    CURPERCENT=`expr $CURRENT "*" $HUNDRED "/" $MAX`
    [snip]
    echo "OK - $host: $CURRENT / $CURPERCENT% | Pages=$CURRENT
    [snip]
    the host name shows correctly but everything else is blank.

    For testing i've tried:

    Code:
    echo "MAX=$MAX REST=$REST CURRENT=$CURRENT CURPERCENT=$CURPERCENT"
    MAX and REST show up the correct values but CURRENT and CURPERCENT don't.

    I figured maybe expr wasnt working correctly but changing it to:
    Code:
    CURRENT=`expr 10 + 1`
    Correctly gives 11 but:
    Code:
    CURRENT=`expr $HUNDRED + 1`
    is blank. Seems to be an issue with doing an expression on a variable. Any ideas anybody?

    Thanks.

  14. #11

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    It works ok here. What shell are you using?

  15. #12

    Join Date
    Jan 2007
    Location
    Birmingham
    Posts
    807
    Thank Post
    29
    Thanked 36 Times in 24 Posts
    Rep Power
    26
    Quote Originally Posted by Geoff View Post
    It works ok here. What shell are you using?
    erm que?

    echo $SHELL gives me /bin/bash

    is that right?

  16. #13

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Does the shell script override that?

  17. #14

    Join Date
    Jan 2007
    Location
    Birmingham
    Posts
    807
    Thank Post
    29
    Thanked 36 Times in 24 Posts
    Rep Power
    26
    top line reads
    Code:
     #! /bin/bash
    so i assume not.

  18. #15

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    and bash is really bash and not symlinked to something else?

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Nagios Problem
    By sqdge in forum *nix
    Replies: 12
    Last Post: 13th January 2012, 10:11 AM
  2. Monitoring HP Switches in Nagios
    By Lee_K_81 in forum *nix
    Replies: 16
    Last Post: 15th July 2011, 08:13 AM
  3. Replies: 51
    Last Post: 10th November 2009, 05:23 AM
  4. Nagios Display
    By plexer in forum How do you do....it?
    Replies: 4
    Last Post: 17th July 2007, 07:43 PM
  5. Ubuntu Nagios
    By plexer in forum How do you do....it?
    Replies: 2
    Last Post: 10th May 2007, 09:21 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
  •