New NagVis Gadget - Printer Supplies

This forum was archived to /woltlab and is now in read-only mode.
  • HI ecrist!
    Thank you for the very helpfull gadget! :)


    I've made some snmpwalks too for our Printers. I hope it help you to expend the gadget. :)


    This is for a HP LaserJet 5100 Series

    Code
    1. mib-2.43.11.1.1.2.1.1 = INTEGER: 1
    2. mib-2.43.11.1.1.3.1.1 = INTEGER: 0
    3. mib-2.43.11.1.1.4.1.1 = INTEGER: 3
    4. mib-2.43.11.1.1.5.1.1 = INTEGER: 3
    5. mib-2.43.11.1.1.6.1.1 = STRING: "TONERPATRONE HP C4129X"
    6. mib-2.43.11.1.1.7.1.1 = INTEGER: 13
    7. mib-2.43.11.1.1.8.1.1 = INTEGER: -2
    8. mib-2.43.11.1.1.9.1.1 = INTEGER: -3


    For hp LaserJet 2430

    Code
    1. mib-2.43.11.1.1.2.1.1 = INTEGER: 1
    2. mib-2.43.11.1.1.3.1.1 = INTEGER: 0
    3. mib-2.43.11.1.1.4.1.1 = INTEGER: 3
    4. mib-2.43.11.1.1.5.1.1 = INTEGER: 21
    5. mib-2.43.11.1.1.6.1.1 = STRING: "Black Cartridge HP Q6511X"
    6. mib-2.43.11.1.1.7.1.1 = INTEGER: 7
    7. mib-2.43.11.1.1.8.1.1 = INTEGER: 12000
    8. mib-2.43.11.1.1.9.1.1 = INTEGER: 2880


    For RICOH Aficio MP 6000


    For NRG DSc332


    And Deskjet 6940 series


    I hope it will help you! I don't know much about MIBs...


    As you've seen... everything in german! :D

  • To all three of you:


    Thanks for the great debug data. If you're running the latest version, and you can run the check command manually from your nagios host, add a 1 as the fifth argument to the command and post the data here. It will output a bunch of debug for me (the OID array) and allow me to fix this.


    I will work on this tomorrow (16:10 here now, CDT).


    here is my output:

  • And here the Debug-Output:




  • And part 2 :D




  • Hi ercist,


    heres my output:

    Thx 4 ur help! :thumbup:


    Cheers,
    Sven

  • Hello ecrist,


    attached the output of some of my printers:


    Ricoh MPC 2500


    ns01:/usr/local/nagios/libexec # ./check_printer 172.17.4.62 public 5 10 1
    $VAR1 = [
    '.1.3.6.1.2.1.43.11.1.1.6.1.1 = STRING: "Toner Schwarz"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.2 = STRING: "Resttoner 1"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.3 = STRING: "Toner Cyan"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.4 = STRING: "Toner Magenta"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.5 = STRING: "Toner Gelb"',
    '.1.3.6.1.2.1.43.11.1.1.7.1.1 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.2 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.3 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.4 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.5 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.8.1.1 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.2 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.3 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.4 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.5 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.9.1.1 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.2 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.3 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.4 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.5 = INTEGER: -3'
    ];
    Key: Toner Cyan
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Toner Magenta
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Toner Gelb
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Toner Schwarz
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Resttoner 1
    Cur: 100
    Warn: 5
    Crit: 10
    $VAR1 = {
    'Toner Cyan' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '3',
    'max' => '-2'
    },
    'Toner Magenta' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '4',
    'max' => '-2'
    },
    'Toner Gelb' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '5',
    'max' => '-2'
    },
    'Toner Schwarz' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '1',
    'max' => '-2'
    },
    'Resttoner 1' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '2',
    'max' => '-2'
    }
    };



    ############ ATTENTION ############
    You have debug enabled. If asked to enable debug by the developer,
    please send all of the output, including your command line to
    ecrist@secure-computing.net with the subject line 'check_printer DEBUG' along
    with a description of the problem you're experiencing.
    ###################################
    Printer Supplies OK | 'Toner Cyan'=100%;5;10;0;100 'Toner Magenta'=100%;5;10;0 ;100 'Toner Gelb'=100%;5;10;0;100 'Toner Schwarz'=100%;5;10;0;100 'Resttoner


    NRG dsc428


    ns01:/usr/local/nagios/libexec # ./check_printer 172.19.4.2 public 5 10 1
    $VAR1 = [
    '.1.3.6.1.2.1.43.11.1.1.6.1.1 = STRING: "Toner Schwarz"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.2 = STRING: "Resttoner"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.3 = STRING: "Toner Cyan"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.4 = STRING: "Toner Magenta"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.5 = STRING: "Toner Gelb"',
    '.1.3.6.1.2.1.43.11.1.1.7.1.1 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.2 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.3 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.4 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.5 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.8.1.1 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.2 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.3 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.4 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.5 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.9.1.1 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.2 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.3 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.4 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.5 = INTEGER: -3'
    ];
    Key: Toner Cyan
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Toner Magenta
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Toner Gelb
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Resttoner
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Toner Schwarz
    Cur: 100
    Warn: 5
    Crit: 10
    $VAR1 = {
    'Toner Cyan' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '3',
    'max' => '-2'
    },
    'Toner Magenta' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '4',
    'max' => '-2'
    },
    'Toner Gelb' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '5',
    'max' => '-2'
    },
    'Resttoner' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '2',
    'max' => '-2'
    },
    'Toner Schwarz' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '1',
    'max' => '-2'
    }
    };



    ############ ATTENTION ############
    You have debug enabled. If asked to enable debug by the developer,
    please send all of the output, including your command line to
    ecrist@secure-computing.net with the subject line 'check_printer DEBUG' along
    with a description of the problem you're experiencing.
    ###################################
    Printer Supplies OK | 'Toner Cyan'=100%;5;10;0;100 'Toner Magenta'=100%;5;10;0;100 'Toner Gelb'=100%;5;10;0;100 'Resttoner'=100%;5;10;0;100 'Toner Schwarz'=100%;5;10;0;100


    another MPC2500


    ns01:/usr/local/nagios/libexec # ./check_printer 172.26.4.2 public 5 10 1
    $VAR1 = [
    '.1.3.6.1.2.1.43.11.1.1.6.1.1 = STRING: "Svart toner"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.2 = STRING: "Toneruppsamlare 1"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.3 = STRING: "Cyan-toner"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.4 = STRING: "Magenta-toner"',
    '.1.3.6.1.2.1.43.11.1.1.6.1.5 = STRING: "Gul toner"',
    '.1.3.6.1.2.1.43.11.1.1.7.1.1 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.2 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.3 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.4 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.7.1.5 = INTEGER: 13',
    '.1.3.6.1.2.1.43.11.1.1.8.1.1 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.2 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.3 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.4 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.8.1.5 = INTEGER: -2',
    '.1.3.6.1.2.1.43.11.1.1.9.1.1 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.2 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.3 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.4 = INTEGER: -3',
    '.1.3.6.1.2.1.43.11.1.1.9.1.5 = INTEGER: -3'
    ];
    Use of uninitialized value in subtraction (-) at ./check_printer line 293.
    Key: Toneruppsamlare 1
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Magenta-toner
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Gul toner
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Cyan-toner
    Cur: 100
    Warn: 5
    Crit: 10
    Key: Svart toner
    Cur: 100
    Warn: 5
    Crit: 10
    $VAR1 = {
    'Toneruppsamlare 1' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '2',
    'max' => '-2'
    },
    'Magenta-toner' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '4',
    'max' => '-2'
    },
    'Gul toner' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '5',
    'max' => '-2'
    },
    'Cyan-toner' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '3',
    'max' => '-2'
    },
    'Svart toner' => {
    'uom' => 'gr/10',
    'curr' => -3,
    'sub' => '1',
    'max' => '-2'
    }
    };



    ############ ATTENTION ############
    You have debug enabled. If asked to enable debug by the developer,
    please send all of the output, including your command line to
    ecrist@secure-computing.net with the subject line 'check_printer DEBUG' along
    with a description of the problem you're experiencing.
    ###################################
    Toneruppsamlare 1 CRITICAL. See http://172.26.4.2 | 'Toneruppsamlare 1'=100%;5;10;0;100 'Magenta-toner'=100%;5;10;0;100 'Gul toner'=100%;5;10;0;100 'Cyan-toner'=100%;5;10;0;100 'Svart toner'=100%;5;10;0;100


    Hope this will help.
    thanks in advance


    j.hummer

  • Code
    1. # ./check_printer xxx.xxx.xxx.xxx public 10 20 1


    Your warning and critical numbers are backwards. You want warning to come before critical. So, at 14%, you should be in warning state rather than critical state. This may be why you're having problems.

  • Your warning and critical numbers are backwards. You want warning to come before critical. So, at 14%, you should be in warning state rather than critical state. This may be why you're having problems.


    oh, you are right!


    I get the fault...


    default lib value in your script is '/usr/local/libexec/nagios'..I didn't see that...my lib is here '/usr/local/nagios/libexec" :)


    thx for this plugin!

    The post was edited 1 time, last by mumurik ().

  • Sorry about that. I'm a FreeBSD guy and that's where the default location is. I will add some code to dynamically update the library location on Linux and BSD systems.

  • Can you run those same commands with option On, to get the full numerical OID, and send me the *entire* output from the SNMP walk? I'll need to build some tests in the script to poll varying OID tables depending on manufacturer.


  • Site with latest version is down.
    Any mirrors of this script, since Nagios Exchange is having the old version... (http://exchange.nagios.org/dir…Supply-SNMP-Check/details)



    - UPDATE -
    I managed to get a newer version out of the Google cache at http://bit.ly/ighHgO

    The post was edited 1 time, last by hbokh ().

  • Hi, I've been trying to get this working for quite a few hours now, I've just installed opsview core on CentOS 6.5 and want to use it to monitor servers & printers etc and display graphs on a wallboard via nagvis.


    I installed this nagios plugin: http://exchange.nagios.org/dir…MP-Printer-Check/reviews2 but then found that it doesn't work with your printer supply graph, so I hunted down your check_printer plugin and put that onto my system but haven't been able to get it to work.

    If I run:

    Code
    1. /usr/bin/perl /usr/local/nagios/libexec/check_snmp_print_supply 172.27.1.10 public 10 5

    from a command line it works great (from both root and nagios user)...however...if I try to do it from within opsview as a service check using the arguments:


    Code
    1. -H $HOSTADDRESS$ -C $SNMP_COMMUNITY$ -w 10 -c 5

    or

    Code
    1. -H $HOSTADDRESS$ -C $SNMP_COMMUNITY$ 10 5



    I Get:




    and if I use the arguments:


    Code
    1. -H $HOSTADDRESS$ -C $SNMP_COMMUNITY$



    I just get:

    Code
    1. Printer Supplies OK



    I'd really appreciate some help on this!! I'm very stuck!!

    Thanks in advance! Nick



  • Because when I run the plugin from the command line I am passing those arguments with th IP address, public and the 10 5 for -w -c


    Code
    1. /usr/bin/perl /usr/local/nagios/libexec/check_snmp_print_supply 172.27.1.10 public 10 5
  • I see, I have it working now by removing the -H -C -w -c


    Sorry, its all new to me and I was going off how the arguments were passed in the standard plugins.


    One more question...I only want the graph to show toner levels, I don't want it showing anything else (ie, waste toner, fuser, ITU etc)


    Is there anyway to achieve this??

  • It's the nagvis print_supply.php gadget shown at the beginning of this forum, does anyone else know??

    The post was edited 1 time, last by nickf ().