# Microsoft Skype for Business - Group IM check # # Info: # This powershell plugin for the NSCP Client (former known as NSClient++) can be used to verify that a pair of users are able to take part in a data conference. # A data conference is any conference where collaborative activities such as whiteboarding or annotations are used. # # License: # This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # Revision History: # Version 1.0: 2016-11-22 Bastian W. [Bastian@gmx-ist-cool.de] # * initial version # # FAQ: # How To solve "cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details." # See: http://technet.microsoft.com/en-us/library/ee176949.aspx [a possible solution would be 'Set-ExecutionPolicy RemoteSigned'] # # Installation: # # 1.) # Create a folder on C:\ called "NagiosMonitoring" if it didnīt exist, and put this script into that folder. # # Note: If you use another Foldername, you need to change this script completly! # # 2.) # You need to edit the config below # # Configuration: # ==================== # Create a subset of the previous array for services you want to monitor # Syntax: $SfBPool="sfb_pool_fqdn"; $SfBPool="sfbpool.int.contoso.com"; # # 3.) # Now start a Powershell and run the following comands (to test if the script is working for you) # "C:" # "cd NagiosMonitoring" # ".\NagiosMonitoring_SfB_GroupIM.ps1" # # 4.) # Add this script to the NSClient++ configuration (file: NSC.ini) via: # # [External Scripts] # SfBGroupIMCheck=cmd /c echo C:\NagiosMonitoring\NagiosMonitoring_SfB_GroupIM.ps1 | PowerShell.exe -Command - # # 5.) # uncommend CheckExternalScripts.dll in the NSClient++ configuration (file: NSC.ini) # # 6.) # Create a set of two testusers for the SfB pool you wish to monitor via New-CsHealthMonitoringConfiguration # For more infos see: https://technet.microsoft.com/en-us/library/gg398718.aspx # # 7.) # restart the NSClient++ Service # # 8.) # Start checking the external script via your Nagios environment # ========================================================================================================================= # # ------------- Do not change anything behind that line ! ---------------------------- # # # Buildinfo # used https://technet.microsoft.com/en-us/library/dn743839(v=ocs.15).aspx # initialize vars/reset vars to zero $intNagiosStatus = "0" $strNagiosDescription = "" $bDebugScript = 0 $Service = Test-CsGroupIM -TargetFqdn "$SfBPool" if ($Service.Result -eq "Success") { if ($bDebugScript -eq 1){ Write-Host " Debug:: Check returns success" -foregroundcolor magenta} } else { if ($bDebugScript -eq 1){ Write-Host " Debug:: Check returns something else which is interpreted as error here" -foregroundcolor magenta} $strNagiosDescription = $Service.error $intNagiosStatus="2" } if ($intNagiosStatus -eq "2") { Write-Host "CRITICAL: " $strNagiosDescription } else { Write-Host "OK: Group IM working. " } exit $intNagiosStatus