Results 1 to 10 of 10

Thread: Discover disks - and just disks

Hybrid View

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    20

    Discover disks - and just disks

    Hi,

    In my new Shinken installation I'd like to monitor the disks (partitions) usage.
    I see that there's a shiny new thing to do that in etc/packs/os/linux/services/disks.cfg :-* but I fail to make it work :'(

    Some of my steps (with error messages for search engine posterity):
    Code:
    $ ./fs_discovery_runner.py
    Traceback (most recent call last):
     File "./fs_discovery_runner.py", line 40, in <module>
      import netsnmp
    ImportError: No module named netsnmp
    $ yum install net-snmp-python
    Complete!
    
    $ ./fs_discovery_runner.py -H localhost -m macros -O linux
    localhost::_fs=_root,_dev_shm
    $ ./fs_discovery_runner.py -H localhost -m tags -O linux
    localhost::fs=_root,_dev_shm
    
    $ bin/shinken-discovery -o etc/objects/discovery/ -r nmap -m "NMAPTARGETS=127.0.0.1" -c etc/discovery.cfg
    Error: the nmap return an error: 'sudo: sorry, you must have a tty to run sudo
    $ echo "Defaults !requiretty" >> /etc/sudoers.d/local
    
    $ bin/shinken-discovery -o etc/objects/discovery/ -r nmap -m "NMAPTARGETS=127.0.0.1" -c etc/discovery.cfg
    localhost::ostype=wap
    Is filesystems matching?? False
    
    $ bin/shinken-discovery -o etc/objects/discovery/ -r nmap -m "NMAPTARGETS=10.0.100.20" -c etc/discovery.cfg
    10.0.100.20::os=linux
    Is filesystems matching?? True
    Sorry filesystems was already launched
    $ cat etc/objects/discovery/10.0.100.20/10.0.100.20.cfg 
    define host {
     use  ssh,linux,generic-host
     host_name  10.0.100.20
     address  10.0.100.20
    }
    => still no filesystems
    
    $ echo "localhost::_fs=_root,_dev_shm" >> etc/hosts/localhost.cfg
    $ /etc/init.d/shinken-arbiter restart
    [OK]
    => nothing in Thruk or Shinken UI
    So... HELP!
    How can I enable disk space monitoring ?

  2. #2
    Junior Member
    Join Date
    Apr 2013
    Posts
    20

    Re: Discover disks - and just disks

    I managed to manually activate the monitoring by adding the _fs property to the host definition :
    Code:
    define host {
     ...
     _fs /,/dev/shm
    }
    Is this the proper way, or is it possible to automate the disks discovery ?

  3. #3
    Junior Member
    Join Date
    Apr 2013
    Posts
    20

    Re: Discover disks - and just disks

    Also, I note that the default check_linux_disks command is run without the "-r" (disable regexp) option, so when looking for "/", it uses a regexp and returns all the disks in the perfdata (starting with "/", instead of just "/&quot.

    It would be worth adding it
    Code:
    define command {
        command_name   check_linux_disks
        command_line   $PLUGINSDIR$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $_HOSTSNMPCOMMUNITY$ -m "$ARG1$" -r -f -w $_HOSTSTORAGE_WARN$ -c $_HOSTSTORAGE_CRIT$ -S0,1
    }
    What do you think?

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

    Re: Discover disks - and just disks

    If I'm not wrong, now there is only one check for disks on the linux pack, that will take all that starts with /, so all

    That's the best way to do not forget something I think.
    No direct support by personal message. Please open a thread so everyone can see the solution

  5. #5
    Junior Member
    Join Date
    Apr 2013
    Posts
    20

    Re: Discover disks - and just disks

    The check is instanciated for each '_fs' host property, using the disks discovery (AFAIU).
    Or maybe I didn't understand how to use the disks discovery ?

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

    Re: Discover disks - and just disks

    This was like this on the previous linux pack, but the new version is with not using _fs anymore in fact, to avoid such problems.
    No direct support by personal message. Please open a thread so everyone can see the solution

  7. #7
    Junior Member
    Join Date
    Apr 2013
    Posts
    20

    Re: Discover disks - and just disks

    OK, so 1.2.4 was using _fs, and the next version won't.
    I have the feeling that disks discovery is not fully functional yet in 1.2.4 :'(

    So I guess the recommended way is to revert to good ol' check-all-disks-at-once.

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

    Re: Discover disks - and just disks

    Yes, the discovery scrip changed a lot between 1.2 and 1.2.4 I think, and there should be something wrong here.
    No direct support by personal message. Please open a thread so everyone can see the solution

  9. #9
    Junior Member
    Join Date
    Apr 2013
    Posts
    20

    Re: Discover disks - and just disks

    If other people have this issue in Shinken 1.2.4 (disks not monitored by default), I just edited [tt]/opt/shinken/etc/packs/os/linux/services/disks.cfg[/tt] :
    Code:
    #define service{
    #  service_description  Disks$KEY$
    #  use      generic-service
    #  register    0
    #  host_name   linux
    #  check_command check_linux_disks!$KEY$
    #
    #  duplicate_foreach  _fs
    #}
    define service{
      service_description  Disks
      use      generic-service
      register    0
      host_name   linux
      check_command check_linux_disks
    }
    and [tt]/opt/shinken/etc/packs/os/linux/commands.cfg[/tt]:
    Code:
    define command {
        command_name   check_linux_disks
    #   command_line   $PLUGINSDIR$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $_HOSTSNMPCOMMUNITY$ -m "$ARG1$" -f -w $_HOSTSTORAGE_WARN$ -c $_HOSTSTORAGE_CRIT$ -S0,1
        command_line   $PLUGINSDIR$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $_HOSTSNMPCOMMUNITY$ -m / -f -w $_HOSTSTORAGE_WARN$ -c $_HOSTSTORAGE_CRIT$ -S0,1
    }
    which is essentially what the next Shinken version will ship

    I don't need different actions depending on the disk right now, so I don't need [tt]duplicate_foreach[/tt].
    It also solves my "discovery" issue, because all disks are graphed individually by default (perfdata is returned for all disks) 8)

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

    Re: Discover disks - and just disks

    Thanks for sharing
    No direct support by personal message. Please open a thread so everyone can see the solution

Posting Permissions

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