Giter VIP home page Giter VIP logo

icinga / check_by_powershell Goto Github PK

View Code? Open in Web Editor NEW
16.0 11.0 2.0 5.28 MB

Icinga check plugin to run checks and other commands directly on any Windows system using WinRM (Windows Remote Management). Main use case would be to call one of the plugins from the Icinga Powershell Framework. This will avoid the requirement of installing an Icinga 2 agent on every Windows system.

License: GNU General Public License v3.0

Go 95.43% Makefile 4.57%
icinga2 windows powershell icinga plugin winrm

check_by_powershell's Issues

Copyright Header

Who should be referenced in the Copyright Header? Icinga, NETWAYS GmbH or NETWAYS Professional Services GmbH? From the other repositories I think when moved to Icinga's github space it is normally changed to Icinga.

UNKNOWN - "http response error: 401 - invalid content type

Hello,

i tested the check_by_powershell with the following commandline calls:

./check_by_powershell --host "hostname.fqdn" --auth NTLM --user "DOMAIN\domainuser" --password 'password' --icingacmd "Invoke-IcingaCheckCPU"
./check_by_powershell --host "hostname.fqdn" --auth NTLM --user "hostname\localuser" --password 'password' --icingacmd "Invoke-IcingaCheckCPU"
./check_by_powershell --host "hostname.fqdn" --auth NTML --user "DOMAIN\domainuser" --password 'password' --icingacmd "Invoke-IcingaCheckCPU"
./check_by_powershell --host "hostname.fqdn" --user "hostname\localuser" --password 'password' --icingacmd "Invoke-IcingaCheckCPU"
./check_by_powershell --host hostname.fqdn --auth NTML --user "DOMAIN\domainuser" --password 'password' --icingacmd "Invoke-IcingaCheckCPU"
./check_by_powershell --host hostname.fqdn --auth NTML --user "domainuser@DOMAIN" --password "password" --icingacmd "Invoke-IcingaCheckCPU"
./check_by_powershell --host hostname.fqdn --auth NTML --user "domainuser@DOMAIN" --password 'password' --icingacmd "Invoke-IcingaCheckCPU"
./check_by_powershell --host xxx.xxx.xxx.xxx --auth "NTML" --user "domainuser" --password "password" --icingacmd "Invoke-IcingaCheckCPU"
./check_by_powershell --host xxx.xxx.xxx.xxx --auth "NTML" --user "localuser" --password "password" --icingacmd Invoke-IcingaCheckCPU
./check_by_powershell --host xxx.xxx.xxx.xxx --auth NTML --user "DOMAIN\domainuser" --password "password" --icingacmd "Invoke-IcingaCheckCPU"
./check_by_powershell --host xxx.xxx.xxx.xxx --auth NTML --user "domainuser" --password "password" --icingacmd "Invoke-IcingaCheckCPU"
./check_by_powershell --host xxx.xxx.xxx.xxx --auth NTML --user "domainuser@DOMAIN" --password "password" --icingacmd "Invoke-IcingaCheckCPU"

The result was the followng message:
UNKNOWN - "http response error: 401 - invalid content type"


ref/NC/649281

Check configuration not visible in IcingaWeb2

Hello,

we configured a few checks via check_by_powershell according to the provided command.conf and example.conf.
They are working fine (great work btw ๐Ÿ‘), but unfortunately it is not possible to see the check configuration in IcingaWeb2 anymore:

21-01-_2021_14-04-34

Is it possible to fix this? Being able to see the check configuration is very helpful.

Rename the plugin

The plugin allows you to run any program, not just powershell scripts. For example, the name check_by_winrm describes how the plugin works like check_by_ssh. The plugin check_by_ssh also contains the protocol in the name and not one of the executable formats, e.g. check_by_bash.

Enhancement: Usefull error messages

If Authentication fails the Script only returns the message "401 - invalid content type".
Even in Debug mode there is no information what caused this error.

Maybe its possible to show the full response from the Server in Debug ?

results for different authentication methods with powershell methods

Hi!

I tested the different authentication methods.

This was my test:

Invoke-Command -Computername $fqdn -ScriptBlock $scriptblock -Credential $cred -Authentication $auth

Credentials used were

  • user
    domain without domain suffix, user@domain also works
  • password
    singlequoted, because of special characters

I used this source for the auth methods:
https://ss64.com/ps/invoke-command.html

Results:

  • Default
    MI_RESULT_ACCESS_DENIED
  • Basic
    Basic authentication is not supported over HTTP on Unix.
  • Credssp
    MI_RESULT_ACCESS_DENIED
  • Digest
    MI_RESULT_ACCESS_DENIED
  • Kerberos
    OpenError: [%fqdn%] Connecting to remote server %fqdn% failed with the following error message : Kerberos verify cred with password failed No credentials were supplied, or the credentials were unavailable or inaccessible For more information, see the about_Remote_Troubleshooting Help topic.
  • Negotiate
    works
  • NegotiateWithImplicitCredential
    Cannot bind parameter 'Authentication' to the target. Exception setting "Authentication": "A Credential cannot be specified when NegotiateWithImplicitCredential is specified."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.