RabbieBurns Posted October 27, 2009 Posted October 27, 2009 I'm trying to create a plugin for nagios to get the consumables status for our Konica K5440dl printers. I tried a snmpwalk on one and it only goes so far so I was hoping to try and copy the HP 2600 one which uses wget to download the supplies status webpage to a temporary file and then extracts the details from that. Ben Can you post the one you use for the HP 2600 please?
plexer Posted October 27, 2009 Author Posted October 27, 2009 I'll look it up when I'm back at work next week. Ben
ind1ekid Posted October 30, 2009 Posted October 30, 2009 A bit off topic, but i didnt see the point making a new thread for this question what with all the linux scripting goin on here! I want to copy a set of folders to another folder, but log what files are processed at the same time to a text file: so i got something like this, but my file ends up empty cp -R -v /Source /Destination > /Destination/Log.file Do i need to use cat and pipe it in there somehow? Cheers in advance peeps
powdarrmonkey Posted October 30, 2009 Posted October 30, 2009 so i got something like this, but my file ends up empty cp -R -v /Source /Destination > /Destination/Log.file Works for me.. $ cat Destination/log `Source/file2' -> `Destination/Source/file2' `Source/file1' -> `Destination/Source/file1' $
tom_newton Posted October 30, 2009 Posted October 30, 2009 cp -Rv ./baz/ ./bar/ > foo seems to work here tom@flying-squirrel:/tmp/foo$ cat foo `./baz/' -> `./bar/baz' `./baz/flibb' -> `./bar/baz/flibb' `./baz/quux' -> `./bar/baz/quux' 1
ind1ekid Posted October 30, 2009 Posted October 30, 2009 cp -Rv ./baz/ ./bar/ > foo seems to work here tom@flying-squirrel:/tmp/foo$ cat foo `./baz/' -> `./bar/baz' `./baz/flibb' -> `./bar/baz/flibb' `./baz/quux' -> `./bar/baz/quux' Cheers Worked a charm, I wasnt far off I guess!
powdarrmonkey Posted October 30, 2009 Posted October 30, 2009 ...what exactly did you do differently? I used your exact command to test.
ind1ekid Posted October 30, 2009 Posted October 30, 2009 ...what exactly did you do differently? I used your exact command to test. lol... i have no idea now ive just looked at them both again its working now anyway!
RabbieBurns Posted November 6, 2009 Posted November 6, 2009 I'll look it up when I'm back at work next week. Ben Just a nudge in case this had slipped your mind. Im installing nagios just now and all our printers are those HPs pretty much..
plexer Posted November 6, 2009 Author Posted November 6, 2009 Thanks for the nudge I hadn't forgotten I just hadn't got round to doing it yet. I've posted it up on my blog plextech Thanks. Ben 1
RabbieBurns Posted November 6, 2009 Posted November 6, 2009 Thankfully I cant access work from home, so ill need to give it a try on Monday... Thanks in advance though
RabbieBurns Posted November 9, 2009 Posted November 9, 2009 Thanks for the nudge I hadn't forgotten I just hadn't got round to doing it yet. I've posted it up on my blog plextech Thanks. Ben How do I go about installing it as a plugin?
RabbieBurns Posted November 23, 2009 Posted November 23, 2009 OK this seems to be working.. But how now do I implement it into nagios?? root@nagios:/usr/local/nagios/libexec# php check_hp2600.php -H 10.0.5.101 -c 10 -w 15 TONER OK C:32 M:99 Y:32 K:22
RabbieBurns Posted November 23, 2009 Posted November 23, 2009 Got it sorted! I had to add this to commands.cfg # 'check_hp2600' command definition define command{ command_name check_hp2600 command_line php /usr/local/nagios/libexec/check_hp2600.php -H $HOSTADDRESS$ -c 10 -w 15 } And then in printers.cfg i made a new group called 2600-printers which calls the previous command define service{ use generic-service ; Inherit values from a template hostgroup_name 2600-printers ; The name of the host the service is associated with service_description Printer Status ; The service description # check_command check_hpjd!-C public ; The command used to monitor the service check_command check_hp2600 ; The command used to monitor the service normal_check_interval 10 ; Check the service every 10 minutes under normal conditions retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined } And then just specified all the printers in host declarations define host{ use generic-printer ; Inherit default values from a template host_name 10.0.5.101 ; The name we're giving to this printer alias 10.0.5.101 ; A longer name associated with the printer address 10.0.5.101 ; IP address of the printer hostgroups 2600-printers ; Host groups this printer is associated with notifications_enabled 0 ; disable emails for this check } I hope this helps someone else
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now