Results 1 to 3 of 3

Thread: [Tip] Plugin returns too much data for nrpe and/or check_nrpe

  1. #1

    [Tip] Plugin returns too much data for nrpe and/or check_nrpe

    In my env, I check disk space locally whith nrpe and check_disk -r <regexp to match interresting mount points>.
    On one of my servers, I have a lot of lvm logical volumes I want to monitor all of them in one check. I saw the check_nrpe truncate the returned values, so I did not have all my volumes in perfdata. I did not want to recompile all my nrpe agents nor my check_nrpe plugins.
    So I wrote a wrapper in bash. Set nagios account .ssh/authorized_keys to use it with the server key:
    Code:
    no-pty,no-port-forwarding,command="/usr/local/bin/check_by_ssh_wrapper $SSH_ORIGINAL_COMMAND" ssh-rsa AAAA…
    And I use check_by_ssh the same way I used check_nrpe for this host, just have to had it in my many-disks hostgroup:
    Code:
    # Check by ssh with check_by_ssh_wrapper installed on client
    define command{
        command_name check_by_ssh
        command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -l nagios -C '$ARG1$ $ARG2$'
    }
    # Check disk space
    define service{
        use           base-service-prod
        service_description   check_disks
        display_name      Check Disks
        hostgroup_name     lin-servers!many-disks
        check_command      check_nrpe!check_disks
    }
    
    # Check disk space with lot of disks
    define service{
        use           base-service-prod
        service_description   check_disks
        display_name      Check Disks
        hostgroup_name     lin-servers&many-disks
        check_command      check_by_ssh!check_disks
    }
    The wrapper code is available here: http://landry.minoza.free.fr/Dev/che...by_ssh_wrapper (sorry, doesn't have a git*.com account yet

  2. #2
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: [Tip] Plugin returns too much data for nrpe and/or check_nrpe

    Good hack, congrats
    No direct support by personal message. Please open a thread so everyone can see the solution

  3. #3

    Re: [Tip] Plugin returns too much data for nrpe and/or check_nrpe

    L’emplacement à changé, ce code est maintenant hébergé sur GitHub: https://github.com/hobgoblinsmaster/...by_ssh_wrapper, explications du fonctionnement ici: http://hobgoblins-master.info/posts/...h_wrapper.html.

Posting Permissions

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