GithubHelp home page GithubHelp logo

squaredup / community.dataondemand.mp Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 1.42 MB

The Data on Demand Management Pack contains a number of useful System Center Operations Manager (SCOM) agent tasks, including the Netstat task required by Squared Up Visual Application Discovery & Analytics.

License: GNU General Public License v3.0

PowerShell 88.23% Shell 7.29% Perl 4.48%

community.dataondemand.mp's People

Contributors

abdul561 avatar clarkd avatar dominicjeremiah2020 avatar mortenlerudjordet avatar paul-watson-squaredup avatar shadeon avatar shaswot77 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

community.dataondemand.mp's Issues

Kernel owned connection results in empty process columns, causing VADA to fail

Kernel owned processes do not list pid information when running Netstat with process information (column is - or empty). This means the results cannot be parsed by VADA downstream.

See an example here:

https://community.squaredup.com/answers/question/linux-vada-not-running-on-rh67/

Since other tools may or may not be able to correctly detect the owning component, and those tools are not standard on all supported distributions, it may make sense to simply use an intentionally invalid PID and report the proc name as "Unknown" (as done on Windows).

This would also mitigate some of the issues with permissions some folks are seeing - although the netstat input would be incomplete and/or missing proc information, you would not be forced to run as root when using the task in many cases if all you want is inbound/outbound connections.

Netstat task supported on Linux servers

The GetNetstatCsv Task provides valuable information on application dependencies (in particular, to VADA) but currently is only supported on windows platforms.

It would be great if this task were to be implemented supporting the same unix/linux platforms as SCOM itself (for reference, that list can be found here.

Ideally, the output format would be the same so that downstream tools can consume this data as they would with the existing windows version today.

Unix Netstat task incorrectly handles IPv6 addresses

The netstat task is naively converting all ':' characters to ',' in an effort to split the Endpoint address and port number. This means:

  1. IPv6 or IPv4 mapped addresses are no longer valid
  2. The file is no longer a valid CSV, as it includes additional columns

Instead of using gsub() to cheat, the substrings should be extracted correctly using match() and substr().

json format is only supported on windows systems that have PowerShell v3 or later.

Currently the json format is not supported on any windows hosts that do not have PowerShell version 3.0 or later, as Convertto-json is not available.

Since most modern operating systems are now PS v3 or later, the task description will be updated to state the json format is only available in those cases, as several other formats are supported and work fine on those platforms.

Windows Task scripts support list format

Windows PowerShell based tasks currently support a formatted table (via format-table) but do not support a formatted key:value output other than json.

Emitting data in a formatted list (ala Format-List) should be a viable configuration option.

List Windows Updates

I've created the needed files to allow a new on-demand task which, with it's default config, will list the 10 most recent Windows Updates that have been applied to the targeted Server. I'm not familiar with using GIT and I have no idea if I would even have rights to commit to the repo; so, i'm providing the files here so someone can include them into the MP.

Pete
GetWindowsUpdates.zip

Support "Get DNS Cache" task on older windows systems

The Get DNS Cache task depends on the Get-DNSClientCache PowerShell cmdlet, which itself depends upon WMI classes not available on Windows 2008 R2 and below.

This task could easily be replaced with an implementation that makes use of native windows commands (ipconfig /displaydns) which would allow for support across 2003/2008 systems.

Windows task scripts other than Get-Netstat do not return valid CSV documents

When outputting CSV formatted data, all task scripts (other than Get-Netstat) emit the serialized type header prior to outputting the CSV data itself.

This is causing downstream tools issues when trying to parse the returned data.

As a simple fix, the -NoTypeInformation switch can be added to ConvertTo-CSV to prevent this information from being emitted.

Get Netstat CSV (Data On Demand) for Linux is failing & not retrieving any information

The problem lies with the Microsoft.SystemCenter.WSManagement.Library!Microsoft.SystemCenter.WSManagement.Invoker ProbeAction type used in the workflow.
It doesn’t work in SCOM 2019!!

MicrosoftUnixShellCommandLibrary!Microsoft.Unix.Invoke.Script.ProbeAction must be used instead, with the GetNetstatCSV.sh script encoded Base64.

Also, there are problems with the script itself as netstat might return LOTS of ESTABLISHED TCP connections.
Some kind of limit or process filtering must be put in place at script level (via arguments), otherwise script will time out without returning anything.

Linux Netstat discovery issues

A number of issues have been reported with Linux Netstat discovery:

  1. Timeout of 60 seconds is slightly too short in some cases
  2. CSV output does not correctly escape double quote characters at the start/end of the string
  3. Encoding issues in management pack XML in some SCOM versions

Unix/Linux netstat task displays path as part of process description

Currently the netstat task on unix/linux includes the path to the binary if that was specified when the process was created.

This can often lead to a long string with superfluous information, which could probably be removed. If this information was specific in certain cases, it would probably be more appropriate to move this to the Name column, as the path is clearly forming part of the identifier.

Get processes task incorrectly reports CPU percent column

The CPU Percent value returned by the task is based on a WMI perf counter that is capped at the value of 100. On multi-core systems where threads are being run across multiple cores, the time value will likely exceed 100. This can cause wildly inaccurate figures on systems that have a large number of cores.

To resolve this, we instead need to collect the CPU % for each thread in the process (via Win32_PerfFormattedData_PerfProc_Thread, ignoring any instances matching _Total) and sum them, dividing by the total number of logical cores.

In addition, many of the other properties are actually available on the System.Diagnostics.Process class - the only one that is not is the Creating process - this value could instead be queried from the WMI_Process class.

[Suggestion] PS scripts: Put the sorted property first

This might just be a personal preference, though I will leave this up to others.

For the PS scripts put the property being sorted at the front.

Current:
| Sort-Object -Property Name `
| Select-Object DisplayName, Status, Name

Proposed:
| Sort-Object -Property Name `
| Select-Object Name, Status, DisplayName

In my opinion this looks better when running an on demand task.
But I will let others decide.

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.