Jonathan Arnold

LogicMonitor Staff
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Jonathan Arnold

  • Rank
    Community Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. You are correct in groovy you can do an instanceProps.get() – return the specified instance property e.g. instance = instanceProps.get("wildvalue") This is available if you import the santaba module for Groovy. Unfortunately, we don't have anything like that for Powershell at this time.
  2. Hi Joe, Instance Level Properties (ILP's) are available in PowerShell Active Discovery scripts as long as they fit the following format as output. https://www.logicmonitor.com/support/datasources/active-discovery/script-active-discovery/ instance5_id##instance5_name##instance5_description####auto.fooProperty=somevalue&auto.barProperty=anothervalue instance6_id##instance6_name##instance6_description####auto.fooProperty=thisvalue&auto.barProperty=thatvalue Is this what you are trying to accomplish? Or are you trying to use a Powershell PropertySource?
  3. At LM we are issued MacBooks and support gets a few VM's (Windows and Linux) so we can test new features and replicate bugs that customers come to us with. But with taking an interest in Powershell it was getting tiresome remoting into a Windows VM to test a Datasource or API script every time one came in. Then I heard about Microsofts push to release Powershell on GitHub, I tried the alpha build and had great success and with the beta release of 6.0 they refind the install process so I thought it was time to share my experience. Disclamier: This version of Powershell for the Mac DOES NOT include some of the Windows only cmdlets (including Get-WIMObject and Hyper-v's Get-VM) so you may not be able to test those but you can still use intellisense to help write the scripts. The new install process is very easy you just need a terminall session on your MacBook and the latest Mac OSx build of 10.12: 1. We start by installing Homebrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2. Now we can install Homebrew-Cask so we can install more packages brew tap caskroom/cask 3. Now for Powershell brew cask install powershell Note: The PowerShell formula for Homebrew includes OpenSSL as a dependency. "On macOS, .NET Core requires Homebrew's OpenSSL because the "OpenSSL" system libraries on macOS are not OpenSSL, as Apple deprecated OpenSSL in favor of their own libraries. This requirement is not a hard requirement for all of PowerShell. However, most networking functions (such as Invoke-WebRequest) do require OpenSSL to work properly." If you would like to install without OpenSSL you will lose some functionality but you can follow the steps here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#macos-1012 When new versions of Powershell are released simply update Homebrew and upgrade PowerShell brew update brew reinstall powershell Note: because of this issue in Cask (https://github.com/caskroom/homebrew-cask/issues/29301), you currently have to do a reinstall to upgrade. Now with that out of the way we just need a nice place to look at, debug and run Powershell. So VisualStudio Code works very well for this and you can download the Mac version here https://code.visualstudio.com/ Once you have installed this lets open it up and add the Powershell Extension: 1. Open VScode 2. Click the 5th icon on the left side 3. Search for Powershell and Install the one from Microsoft 4. Once installed click the reload button that replaced install so that the extension loads 5. Now you can open a .ps1 script or create your own! Feel free to add other scripting languages as well from the massive list of extensions that they haveNow if (for some crazy reason) you need to uninstall Powershell, Homebrew makes that easy as well brew cask uninstall powershell Now go have fun and write some cool API or Datasource scripts to share!
  4. One of our customers wanted a datasource that has instances that call from each database. Trying to use the auto discovery in the datasource for jdbc with a discovery type of "Database List" so that they could monitor each customer's database the same way. So the above per our documentation explains how this should work, but this will return port#:databaseName. It will pass this to the ##WILDCARD## as port#databaseName (ex: 1433testDB). This is great if you want to see where you have what databases, but if you want to monitor the individual database then it won't work since the database is not written in that form. To do this you can change the active discovery to be "Instance List" and write a SQL statement that will return the database names (Select name as databasename From sys.databases) This will discover all of the databases that are in the master database and pass them as wildcards to the collector which you can use in the URL, and then you are able to write a SQL statement that will query all of the databases the same way. Quotes via: https://www.logicmonitor.com/support/datasources/active-discovery/jdbc-active-discovery/