Jump to content

Lee_K_81

Members
  • Posts

    810
  • Joined

  • Last visited

Everything posted by Lee_K_81

  1. Here's the modified script. Hope this helps somebody else. usage (based on HP LaserJet 2600n retrieving black toner usage): ./check_hp_toners -H 10.122.1.10 -OC .1.3.6.1.2.1.43.11.1.1.9.1 -OM .1.3.6.1.2.1.43.11.1.1.8.1.1 -p 2500 -C public where: -H = host address -OC = oid for current toner remaining -OM = oid for maximum toner -p = approx pages specified by manufacturer -C = community string #! /bin/bash # # Original Script # Nagios-Plugin zum überprüfen von Verbrauchsmaterialien in HP Druckern # Last Modified: 20-10-2006 # # Modified by Lee Kilcullen # Date: 14-05-2008 # Paths to commands used in this script. These # may have to be modified to match your system setup. PATH="/usr/local/nagios/" SNMPGET="/usr/bin/snmpget" EXPR="/usr/bin/expr" PROGNAME=`/usr/bin/basename $0` PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` REVISION=`echo '$Revision: 1.4 $' | /bin/sed -e 's/[^0-9.]//g'` . $PROGPATH/utils.sh print_usage() { echo "Usage: $PROGNAME -H Host -OM OID-Max -OC OID-Cur -w Warn in % -c Critical in % -t Toner OID -C community string" echo "Usage: $PROGNAME --help" echo "Usage: $PROGNAME --version" } print_help() { print_revision $PROGNAME $REVISION echo "" print_usage echo "" echo "Überprüfe Verbrauchsmaterial von HP-Druckern" echo "" support } # Make sure the correct number of command line # arguments have been supplied if [ $# -lt 1 ]; then print_usage exit $STATE_UNKNOWN fi # Grab the command line arguments exitstatus=$STATE_WARNING #default while test -n "$1"; do case "$1" in --help) print_help exit $STATE_OK ;; -h) print_help exit $STATE_OK ;; --version) print_revision $PROGNAME $VERSION exit $STATE_OK ;; -V) print_revision $PROGNAME $VERSION exit $STATE_OK ;; --host) host=$2 shift ;; -H) host=$2 shift ;; --oidmax) oidmax=$2 shift ;; -OM) oidmax=$2 shift ;; --oidcur) oidcur=$2 shift ;; -OC) oidcur=$2 shift ;; --warn) warn=$2 shift ;; -w) warn=$2 shift ;; --current) critical=$2 shift ;; -c) critical=$2 shift ;; -x) exitstatus=$2 shift ;; --exitstatus) exitstatus=$2 shift ;; -p) pages=$2 shift ;; -C) comm=$2 shift ;; *) echo "Unknown argument: $1" print_usage exit $STATE_UNKNOWN ;; esac shift done #get maximum amount of toner max=`/usr/bin/snmpget -O Uvqs -v 1 -c $comm $host $oidmax` #get current amount of toner rem=`/usr/bin/snmpget -O Uvbqs -v 1 -c $comm $host $oidcur` hundred=100 #calculate approximate number of pages remaing based on maximum toner capacity, #manufacturer advised number of pages and remaing toner. rempages=`/usr/bin/expr $pages "/" $max "*" $rem` #calculate current percentage of toner remaining curpercent=`/usr/bin/expr $rem "*" $hundred "/" $max` if [[ -z $max ]]; then echo "CRITICAL - $host seems to be dead" exitstatus=2 elif [[ $curpercent -gt $critical ]]; then echo "OK - $host: $curpercent% remaining |Pages remaining=$rempages;" exitstatus=0 elif [[ $curpercent -lt $critical ]]; then echo "Critical - $host: $curpercent% remaining |Toner will need replacing soon - approx $rempages pages remaining;" exitstatus=2 elif [[ $curpercent -lt $warn ]]; then echo "Warning - $host: $curpercent% remaining |Toner needs ordering - approx $rempages pages remaining;" exitstatus=1 else echo "UNKNOWN - I see dead people - Something is wrong" exitstatus=3 fi exit $exitstatus Lee
  2. It's all sorted. For some reason re-typing the variable assignments and the expr statement fixed it. Not sure if it's because i'd downloaded it off the net and ended up with some hidden chars maybe? I did run tofrodos and that solved some other problems but not that one. Just in the process of upgrading the firmware on some of the older printers now as they dont give the toner levels out via snmp without it. Also changed way the original calculated the usage as it gave the amount used rather than amount remaining. The adjusted script is below in case anybody wants to check their HP toner usage in nagios.
  3. but almost as bad as publisher ;-)
  4. try this link: http://office.microsoft.com/en-us/publisher/HA010563151033.aspx Not sure if it will help. Maybe you could update her version of publisher.
  5. Have you tried my suggestion of going to "File -> publish to the web" even if she saves it to a seperate directory on her HDD which she then uploads from. I think it should work as Visual Studio has a similar function. Hope it helps.
  6. how are they uploading to the web? going to a website and uploading the file or going to file | publish to the web. This should save it to a file without the file://C:\Documents%20and%20Settings\ addressing. I'm using 2003 so i assume it should be the same in 2002. Failing that teach them web development, rather than using publisher of all things! ;-)
  7. I'm assuming he's doing a restore of the CMIS data, not the entire OS. It would be mainly I/O operations on the SQL DB.
  8. Oh and by the way, happy birthday Neil. :-)
  9. We moved away from split server installs as we were getting more problems although CMIS was on a DC running lots of other things and eportal was on a windows 2000 server with 750MB RAM and 900MHz processor. Putting both on to a HP DL380 G5 server with 2x 3GHz Intel Dual core XEONs and 4GB RAM has worked a treat. Not had any issues so far (almost 12 months). I know there were some issues with memory leaks but i've not noticed any issues.
  10. Sorry Neil, I've not tried to virtualise Facility, I dont think virtualisation of this type of system would be worthwhile unless a fibre SAN was involved. The issue you have is that the Virtualised system doesnt actually write anything itself, it just thinks it does. The host system physically writes it to the drive. Major overheads. Are the drives in your server SAS or SATA? If you are going to stick with the virtualised way of doing things your only way is SAN - if you are using the HP MSA range make sure you use SAS drives too - more expensive but as CMIS is constantly reading and writing from the SQL Database it is needed. Lee
  11. I would absolutely love it (very keegan-esque) if schools had something similar to ofsted, and strict guidelines about what standards they MUST adhere to. One of the biggest issues i have is people either ignoring my advice / suggestions and doing something anyway. Then myself and my department are told to "make it work". Ring-fenced funding would also be a good idea. I know schools leadership are reluctant to sign off on expensive items without being sure of value for money so maybe partnerships with other local schools, with peer-assessment / authorisation from other network managers. School's leadership don't often seem to understand what they cant see. e.g. spending £15k on 30 PCs is something tangible, they can see the PCs, they can see the effect it has on the pupil : PC ratio. Spending 10k on manageable gigabit switches is something they can't see the impact of. They dont understand things like network capacity, bandwidth, bottle necks, loopbacks, etc.. Many also bury their heads in the sand when you try and explain as they "don't do technical"!
  12. after a bit more research it seems that expr doesnt like the values that snmpget gets. It seems to think they are not "non-numeric arguments". The values seem to have a space after them. Is there a way to cast to a value? Or atleast trim the trailing space off the value? Thanks
  13. What about subsequent visits? If they always visit during a weekday 9-5 then most people wont be in. I'm assuming your called your local council and services (telephone, gas, electricity, cable/sky, etc.) to advise them that you are the new tennant and the date you moved in. Those are debts that could be seen as being to the house as you could be using those services. If the letters from baliffs / debt collectors have a company name / telephone let them know. As others have said dont let anybody in, even somebody who looks weedy / selling something / trying to get you to change services could try to be helpful and hold the door for your other "vistor" who turns up.....
  14. i've not done that (i dont think) so unless it happens without knowing......
  15. top line reads #! /bin/bash so i assume not.
  16. erm que? echo $SHELL gives me /bin/bash is that right?
  17. 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: 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: 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: CURRENT=`expr 10 + 1` Correctly gives 11 but: CURRENT=`expr $HUNDRED + 1` is blank. Seems to be an issue with doing an expression on a variable. Any ideas anybody? Thanks.
  18. 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.
  19. 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.
  20. 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
  21. 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 © 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
  22. Ha ha, i like the way the "home" link at the end is dead! How ironic!
  23. Lee_K_81

    <3

    lol, how long til this thread gets locked!
  24. Lee_K_81

    <3

    so..... ~c==3 ........
×
×
  • Create New...