Windows ZenPack

Overview

  • Methods of Monitoring
    • WMI enumeration over winrm
    • PowerShell using a remote shell over winrm
  • Differences
    • WMI queries through DCOM
      • Mostly modeling. Service, IIS, Process, WinRMPing datasources
    • Powershell for everything else

Authentication

  • Local Authentication
    • Simple user/password sent over clear text
    • Can be useful for tcpdump
  • Domain Authentication (Kerberos)
    • Encrypted
    • Single user over multiple trusted domains

Kerberos Authentication

../_images/kerberos.png

Process:

  • Kinit asks for a krbtgt (kerberos ticket granting ticket) from the kdc
    1. a.Sends user/pass to kdc for authentication
    2. b.Any error messages you see that begin with kinit: only deal with authenticating to the kdc
  • After successful login, we then create a context for the device to send our winrm messages
    1. c.We request from the kdc a ticket to use the HTTP/HTTPS/WSMAN(2.7.0) service on the device
      1. Server not found in kerberos database
      2. Usually reverse DNS mismatch
      3. HTTPS is the only spn that would need to be added
      4. zWinRMKrb5DisableRDNS
    2. b.Successfully get HTTP/HTTPS/WSMAN ticket
      1. i.Happily send/receive encrypted payloads to/from device
  • Trusted realms
    1. d.If an org has a trust between other domains, a single user can be used from the main domain
    2. e.Set up zWinKDC, zWinRMServerName, zWinRMPassword normally
    3. f.Use zWinTrustedRealm/zWinTrustedKDC to specify the domain and kdc for that domain

Example:

  • example.com is the main domain

  • austin.example.com is a trusted subdomain

    • zWinKDC: dc01.example.com (recommend using ip for fewer dns lookups)
    • zWinRMUserName: zenny@example.com
    • zWinRMPassword: SomeCrazyPassword
    • zWinTrustedRealm: austin.example.com
    • zWinTrustedKDC: dc01.austin.example.com (or ip)

Miscellany

  • Location is /opt/zenoss/var/krb5/krb5.conf
  • Cache files are located in /opt/zenoss/var/krb5cc/user\@domain.com
  • To verify user/pass, at a zenoss prompt:
  • To view cache for a user and verify we have a good ticket for the HTTP/HTTPS/WSMAN service:
    • [zenoss]$ klist -c /opt/zenoss/var/krb5cc/user\@domain.com
  • Extra include directory
    • Default is /opt/zenoss/var/krb5/config
    • zWinRMKrb5inlcludedir
    • Can ONLY contain valid kerberos configuration files
    • Any name you want for the file(s)
  • Enter multiple kdcs for zWinKDC
    • 10.10.10.10, 10.10.10.20, kdc.example.com
  • What do various errors mean? And how to debug or solve?

Performance Counters

Services Monitoring

../_images/windows_monitoring.png
  • Options for Services Monitoring
    • ~130-200 service components per device
    • Templates
      • Making a change to DS can be expensive
    • Windows Services Page
      • Any change IS expensive
  • How does the RegEx work?
  • WinService template, Windows Service datasource
  • Service State
    • Based on Windows services status
    • Running, Stopped, Paused
    • state_state datapoint
  • Service Status
    • Based on zenoss events

Order of precedence for enabling/disabling monitoring

  1. User manually sets monitoring
  2. ‘DefaultService’ datasource from the template associated with the service
  3. Datasource other than the DefaultService in the template associated with the service
  4. Monitoring is enabled via the Infrastructure -> Windows Services page

Note: At least one Windows Service datasource must be enabled

Event Log

  • PowerShell
    • Get-WinEvent for .NET >= 3.5
      • Can use xml generated by MS in Event Viewer
      • Returns EventLogRecord objects
      • $$_.Id
    • Get-EventLog for .NET < 3.5
      • Slower, no xml query
      • Returns EventLogEntry objects
      • $$_.EventID

Performance / Scale

  • What to check for performance/scale issues?
    • Twisted uses file handles for open connections
    • ulimit
  • What to avoid?
    • Very low cycle time for datasources
      • Perfmon ok to have lower interval as the get-counter cmdlet runs over the entire zenpython cycle

Tracing & Logging

What logs are relevant for supporting Windows ZenPack?

Pitfalls / Limitations

  • Encourage users to test windows service datasources in a subclass
  • See wiki
  • Installing 2.7.x can take a long time