Results 1 to 9 of 9

Thread: Again : Check_wmi_plus.pl Warning: This plugin must be either run...

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Location
    Earth
    Posts
    16

    Again : Check_wmi_plus.pl Warning: This plugin must be either run...

    Hello,

    Sorry to ask again this question but it is still unsolved for me :
    check_wmi_plus returns : Warning: This plugin must be either run as root or setuid root.
    I read all the topics concerning SETUID root but my error is not solved
    Here is an extract of my directory :
    What's wrong whith chech_wmi_plus.pl ?

    Code:
    -rwxr-xr-x 1 shinken shinken  34952 juin 28 2012 check_users
    -rwxr-xr-x 1 shinken shinken   2936 juin 28 2012 check_wave
    -rwxr-xr-x 1 shinken shinken   879 juil. 2 2012 check_webinject
    -rwxr-xr-x 1 shinken shinken   6871 juil. 2 2012 check_whois
    -rwxr-xr-x 1 shinken shinken   5767 mars 14 10:08 check_wmi_plus.conf
    drwxr-xr-x 2 shinken shinken   4096 juil. 17 16:08 check_wmi_plus.d
    drwxr-xr-x 2 shinken shinken   4096 juil. 17 16:08 check_wmi_plus.data
    -rwsrwxrwx 1 root  root   322256 mars 14 10:07 check_wmi_plus.pl
    -rwxr-xr-x 1 shinken shinken   8762 juil. 2 2012 check_zone_auth
    -rwxr-xr-x 1 shinken shinken   7731 juil. 2 2012 check_zone_rrsig_expiration
    drwxr-xr-x 2 shinken shinken   4096 juil. 17 14:26 discovery
    -rwxr-xr-x 1 shinken shinken   7051 mars 19 13:53 dump_vmware_hosts.py
    Sorry for boring you with this question but I'm new with Debian and Shinken.

  2. #2
    Junior Member
    Join Date
    Jul 2014
    Posts
    5

    Re: Again : Check_wmi_plus.pl Warning: This plugin must be either run...

    Hello,

    Try to change the user group

    chown root:shinken chech_wmi_plus.pl

  3. #3
    Junior Member
    Join Date
    Jan 2014
    Location
    Earth
    Posts
    16

    Re: Again : Check_wmi_plus.pl Warning: This plugin must be either run...

    Thank you Prisk.

    As you said, I did : sudo chown root:shinken check_wmi_plus.pl
    Now, I have
    Code:
    -rwxrwxrwx 1 root  shinken  322256 mars 14 10:07 check_wmi_plus.pl
    Then restart Shinken but got the same issue...
    Warning: This plugin must be either run as root or setuid root.


  4. #4
    Junior Member
    Join Date
    Jul 2014
    Posts
    5

    Re: Again : Check_wmi_plus.pl Warning: This plugin must be either run...

    Ok, now group is correct.
    Retype chmod u+s on the Check_wmi_plus.pl

  5. #5
    Junior Member
    Join Date
    Jan 2014
    Location
    Earth
    Posts
    16

    Re: Again : Check_wmi_plus.pl Warning: This plugin must be either run...

    Thank you again PrisK !
    Here is what I did :
    Code:
    shinken@SRVDEBIAN:/var/lib/shinken/libexec$ sudo chmod u+s check_wmi_plus.pl
    [sudo] password for shinken: 
    shinken@SRVDEBIAN:/var/lib/shinken/libexec$ ls check_wmi_plus.pl -l
    -rwsrwxrwx 1 root shinken 322256 mars 14 10:07 check_wmi_plus.pl
    shinken@SRVDEBIAN:/var/lib/shinken/libexec$ /etc/init.d/shinken restart
    And now... this plugin still does'nt work and displays the same error :
    Code:
    2014-07-22 11:44:48,543 [1406022288] HOST ALERT: srvhyper-v4;DOWN;HARD;2;Warning: This plugin must be either run as root or setuid root.
    Do you know what I did wrong ?

  6. #6
    Member
    Join Date
    May 2013
    Location
    France - Valence
    Posts
    91

    Re: Again : Check_wmi_plus.pl Warning: This plugin must be either run...

    I am not sure and I cannot test on my current configuration ... but did you try to setuid on your perl binary ?

  7. #7
    Junior Member
    Join Date
    Jan 2014
    Location
    Earth
    Posts
    16

    Re: Again : Check_wmi_plus.pl Warning: This plugin must be either run...

    Thank you mohierf,
    No, I didn't try to setuid on my perl binary...
    But I tried this : Is the result logical for you ?
    Code:
    shinken@SRVDEBIAN:/var/lib/shinken/libexec$ ls check_wmi_plus.pl -l
    -rwsrwxrwx 1 root shinken 322256 mars 14 10:07 check_wmi_plus.pl
    shinken@SRVDEBIAN:/var/lib/shinken/libexec$ sudo check_wmi_plus.pl -h
    sudo: check_wmi_plus.pl: command not found
    shinken@SRVDEBIAN:/var/lib/shinken/libexec$
    However Perl is installed :
    Code:
    shinken@SRVDEBIAN:/var/lib/shinken/libexec$ perl -v
    
    This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi
    (with 88 registered patches, see perl -V for more detail)
    When I try :
    Code:
    shinken@SRVDEBIAN:/var/lib/shinken/libexec$ perl check_wmi_plus.pl -h
    Can't locate Number/Format.pm in @INC (@INC contains: /var/lib/shinken/libexec/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at check_wmi_plus.pl line 55.
    BEGIN failed--compilation aborted at check_wmi_plus.pl line 55.
    But Format.pm is present in those directories :
    Code:
    shinken@SRVDEBIAN:/var/lib/shinken/libexec$ locate Format.pm
    /usr/share/perl5/Date/Format.pm
    /usr/share/perl5/Debconf/Format.pm
    I'm completely lost...

  8. #8
    Member
    Join Date
    May 2013
    Location
    France - Valence
    Posts
    91

    Re: Again : Check_wmi_plus.pl Warning: This plugin must be either run...

    It seems that your perl is installed but not fully functionnal. You should try to remove and reinstall ?

    When I tried this plugin for my Windows server, I followed the Shinken 1.4 installation and I did not meet any problems. But currently, I do not use it anymore ... if I have time, I will make a test on a VM ...

    As far as I remember, check_wmi_plus needs at least those librairies : Number::Format, Config::Inifiles and DataTime ...

    Best regards, Fred.

  9. #9
    Member
    Join Date
    May 2013
    Location
    France - Valence
    Posts
    91

    Re: Again : Check_wmi_plus.pl Warning: This plugin must be either run...

    Hi,
    I made a test this morning and I post here the results for using check_wmi_plus plugin with Shinken 2.0.
    BR, Fred

    Useful links:
    http://www.edcint.co.nz/checkwmiplus/
    https://kb.op5.com/display/HOWTOs/Ag...dows+using+WMI


    On your Windows monitored host :
    - create a user account (shinken / shinken)
    - add this user to Administrators, Distributed COM users and Performance logs users
    - allow DCOM in and WMI in the firewall
    - in WMI console (mmc, WMI snap-in), change security and allow shinken user to: Execute methods, Remote
    - check that WMI service is started


    [tt]
    #su - shinken
    #shinken install windows

    #vi host.cfg
    define host {
    host_name fvc318
    display_name Le PC de Fred ...
    address 192.168.0.31

    use windows, important
    }

    #su -
    #service shinken restart
    #tail -f /var/log/shinken/shinken.log:
    [1406045768] SERVICE ALERT: fvc318;Disks;UNKNOWN;SOFT;2;UNKNOWN - The WMI query had problems. You might have your username/password wrong or the user's access level is too low. Wmic error text on the next line.
    [1406045769] WARNING: [Shinken] Command line: /var/lib/shinken/libexec/check_wmi_plus.pl -H 192.168.0.31 -u "MYDOMAIN\\shinken_user" -p "superpassword" -m checkdrivesize -a '.' -w 90 -c 95 -o 0 -3 1 --inidir=/var/lib/shinken/libexec

    ! The WARNING log is a patch I made in Shinken to log checks command line ...
    ! I see that the command is not correctly built, because WMI access initialization is missing !

    #vi /etc/shinken/resource.d/active-directory.cfg
    # Active Directory and LDAP
    $DOMAIN$=.
    $DOMAINUSERSHORT$=shinken
    $DOMAINUSER$=$DOMAIN$\\$DOMAINUSERSHORT$
    $DOMAINPASSWORD$=shinken
    $LDAPBASE$=dc=eu,dc=society,dc=com

    # Command line test (failed):
    shinken@ipm-dev-srv:~$ /var/lib/shinken/libexec/check_wmi_plus.pl -H 192.168.1.18 -u ".\\shinken" -p "shinken" -m checkeventlog -a application -o 2 -3 1 -w 1 -c 2 --inidir=/var/lib/shinken/libexec/check_wmi_plus.d
    Can't locate Number/Format.pm in @INC (@INC contains: /var/lib/shinken/libexec/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /var/lib/shinken/libexec/check_wmi_plus.pl line 55.
    BEGIN failed--compilation aborted at /var/lib/shinken/libexec/check_wmi_plus.pl line 55.
    #su -
    #cpan (first launch - confirm all proposed choices)
    #cpan Number::Format
    #cpan Config::IniFiles
    #cpan DateTime


    #/var/lib/shinken/libexec/check_wmi_plus.pl -H 192.168.0.31 -u ".\\shinken" -p "shinken" -m checkproc -s cpuabove -a '%' -w 25 -exc _AvgCPU=@0:25 --nodataexit 0 --nodatastring "No processes with high CPU found" --inidir=/var/lib/shinken/libexec/check_wmi_plus.d
    UNKNOWN - The WMI query had problems. You might have your username/password wrong or the user's access level is too low. Wmic error text on the next line.
    [wmi/wmic.c:196:main()] ERROR: Login to remote object.
    NTSTATUS: NT_STATUS_ACCESS_DENIED - Access denied


    # Command line test (succeeded):
    #/var/lib/shinken/libexec/check_wmi_plus.pl -H 192.168.0.31 -u "fvc318\\shinken" -p "shinken" -m checkcpu -w 80 -c 90 --inidir=/var/lib/shinken/libexec/check_wmi_plus.d
    Collecting first WMI sample because the previous state data file (/tmp/cwpss_checkcpu__192168031___.state) contained no data. Results will be shown the next time the plugin runs.
    #/var/lib/shinken/libexec/check_wmi_plus.pl -H 192.168.0.31 -u "fvc318\\shinken" -p "shinken" -m checkcpu -w 80 -c 90 --inidir=/var/lib/shinken/libexec/check_wmi_plus.d
    OK (Sample Period 102 sec) - Average CPU Utilisation CALC_FAIL%
    [/tt]

Posting Permissions

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