diff --git a/examples/ibmmq.yml b/examples/ibmmq.yml new file mode 100644 index 00000000..4f9259d3 --- /dev/null +++ b/examples/ibmmq.yml @@ -0,0 +1,23 @@ +integrations: + - name: nri-flex + interval: 30s + config: + name: ibmmq + apis: + - name: ibmmq-status + event_type: ibmmqStatusSample + commands: + - run: "dspmq" + split: horizontal + set_header: [qname,status] + regex_match: true + split_by: \w+\((.*?)\)\s+\w+\((.*?)\) + - name: ibmmq-queue-depth + event_type: ibmmqQueueDepthSample + commands: + - run: >- + echo "dis ql(*) CURDEPTH" | runmqsc | grep -E 'QUEUE\(|CURDEPTH\(' | sed 's/TYPE(QLOCAL)//' | sed 's/ *//g' | awk 'NR%2{printf "%s ",$0;next;}1' | egrep '^QUEUE\(SYSTEM' + split: horizontal + set_header: [queue,curdepth] + regex_match: true + split_by: \w+\((.*?)\)\s+\w+\((.*?)\) \ No newline at end of file diff --git a/examples/windows/windows-dirwatcher.yml b/examples/windows/windows-dirwatcher.yml index 941a845e..fa058db8 100644 --- a/examples/windows/windows-dirwatcher.yml +++ b/examples/windows/windows-dirwatcher.yml @@ -1,6 +1,6 @@ # Monitor a single file or multiple files in a directory # SELECT * FROM DirWatcher -# Example for NRQL Alert: SELECT count(*) FROM DirWatcher WHERE error IS NOT NULL +# Example for NRQL Alert: SELECT * FROM DirWatcher WHERE fullPath='C:\\Temp\\logs.txt' AND lastModified_hours > '1' integrations: - name: nri-flex interval: 1h # This is the Infrastructure agent polling interval for this Flex configuration, set to one poll every hour @@ -10,14 +10,7 @@ integrations: - event_type: DirWatcher shell: powershell commands: - - run: "Get-ChildItem –Path \"C:/Directory/\" | Foreach-Object {$_.Name+';'+$_.length+';'+$_.length/1KB+';'+$_.length/1MB+';'+$_.length/1GB+';'+$_.DirectoryName+';'+$_.IsReadOnly+';'+$_.Exists+';'+$_.FullName+';'+$_.Extension+';'+$_.CreationTime+';'+$_.CreationTimeUtc+';'+$_.LastAccessTime+';'+$_.LastAccessTimeUtc+';'+$_.LastWriteTime+';'+$_.LastAccessTimeUtc+';'+$_.Attributes+';'+$_.Mode+';'+$_.BaseName+';'+$_.LinkType}" + - run: "Get-ChildItem -Path \"C:/Temp/logs.txt\" | Foreach-Object {$_.Name+';'+$_.length+';'+$_.length/1KB+';'+$_.length/1MB+';'+$_.length/1GB+';'+$_.DirectoryName+';'+$_.IsReadOnly+';'+$_.Exists+';'+$_.FullName+';'+$_.Extension+';'+$_.CreationTime+';'+$_.CreationTimeUtc+';'+$_.LastAccessTime+';'+$_.LastAccessTimeUtc+';'+$_.LastWriteTime+';'+$_.LastAccessTimeUtc+';'+$_.Attributes+';'+$_.Mode+';'+$_.BaseName+';'+$_.LinkType+';'+((Get-Date)-$_.LastWriteTime).TotalHours}" split: horizontal - set_header: [fileName, fileSize, fileSize_kb, fileSize_mb, fileSize_gb, directoryName, isReadOnly, exists, fullPath, fileExtension, creationTime, creationTimeUtc, lastAccessTime, lastAccessTimeUtc, lastWriteTime, lastWriteTimeUtc, attributes, mode, baseName, linkType] - split_by: ";" - - event_type: DirWatcher - shell: powershell - commands: - - run: "Get-ChildItem –Path \"C:/Another_Directory/single_file.bak\" | Foreach-Object {$_.Name+';'+$_.length+';'+$_.length/1KB+';'+$_.length/1MB+';'+$_.length/1GB+';'+$_.DirectoryName+';'+$_.IsReadOnly+';'+$_.Exists+';'+$_.FullName+';'+$_.Extension+';'+$_.CreationTime+';'+$_.CreationTimeUtc+';'+$_.LastAccessTime+';'+$_.LastAccessTimeUtc+';'+$_.LastWriteTime+';'+$_.LastAccessTimeUtc+';'+$_.Attributes+';'+$_.Mode+';'+$_.BaseName+';'+$_.LinkType}" - split: horizontal - set_header: [fileName, fileSize, fileSize_kb, fileSize_mb, fileSize_gb, directoryName, isReadOnly, exists, fullPath, fileExtension, creationTime, creationTimeUtc, lastAccessTime, lastAccessTimeUtc, lastWriteTime, lastWriteTimeUtc, attributes, mode, baseName, linkType] + set_header: [fileName, fileSize, fileSize_kb, fileSize_mb, fileSize_gb, directoryName, isReadOnly, exists, fullPath, fileExtension, creationTime, creationTimeUtc, lastAccessTime, lastAccessTimeUtc, lastWriteTime, lastWriteTimeUtc, attributes, mode, baseName, linkType, lastModified_hours] split_by: ";" diff --git a/examples/windows/windows-gpusample.yml b/examples/windows/windows-gpusample.yml new file mode 100644 index 00000000..4c0aa131 --- /dev/null +++ b/examples/windows/windows-gpusample.yml @@ -0,0 +1,15 @@ +# SELECT gpuName, gpuDriverVersion, gpu3D_percent, gpuCopy_percent, gpuEncode_percent, gpuDecode_percent, gpuDedicatedMemoryUsage_GB, gpuSharedMemoryUsage_GB FROM GpuSample LIMIT MAX SINCE 5 MINUTES AGO +# Example for NRQL Alert: SELECT count(*) FROM GpuSample WHERE error IS NOT NULL +integrations: + - name: nri-flex + interval: 30s # This is the Infrastructure agent polling interval for this Flex configuration, set to one poll every 30 seconds + config: + name: GpuSample + apis: + - event_type: GpuSample + shell: powershell + commands: + - run: (Get-WmiObject Win32_VideoController).Name+';'+(Get-WmiObject Win32_VideoController).DriverVersion+';'+([math]::Round((((Get-Counter "\GPU Engine(*engtype_3D)\Utilization Percentage").CounterSamples | where CookedValue).CookedValue | measure -sum).sum,2))+';'+([math]::Round((((Get-Counter "\GPU Engine(*engtype_Copy)\Utilization Percentage").CounterSamples | where CookedValue).CookedValue | measure -sum).sum,2))+';'+([math]::Round((((Get-Counter "\GPU Engine(*engtype_VideoEncode)\Utilization Percentage").CounterSamples | where CookedValue).CookedValue | measure -sum).sum,2))+';'+([math]::Round((((Get-Counter "\GPU Engine(*engtype_VideoDecode)\Utilization Percentage").CounterSamples | where CookedValue).CookedValue | measure -sum).sum,2))+';'+([math]::Round((((Get-Counter "\GPU Process Memory(*)\Dedicated Usage").CounterSamples | where CookedValue).CookedValue | measure -sum).sum/1GB,2))+';'+([math]::Round((((Get-Counter "\GPU Process Memory(*)\Shared Usage").CounterSamples | where CookedValue).CookedValue | measure -sum).sum/1GB,2)) + split: horizontal + set_header: [gpuName, gpuDriverVersion, gpu3D_percent, gpuCopy_percent, gpuEncode_percent, gpuDecode_percent, gpuDedicatedMemoryUsage_GB, gpuSharedMemoryUsage_GB] + split_by: ";"