Skip to content
23 changes: 23 additions & 0 deletions examples/ibmmq.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
integrations:
- name: nri-flex
interval: 30s
config:
name: ibmmq
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this telemetry something that could be also scraped using the ibmmq integration ? If so , there is any difference on the data collected ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was created to address IBMMQ version 8 and 7. I've tested the IBMMQ integration and it does not work for IBM MQ version 8, which is why we opted for a flex script instead. As well, the IBMMQ integration states support for version 9+. This flex script works on version 7, 8 and 9 when I tested it.

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+\((.*?)\)
13 changes: 3 additions & 10 deletions examples/windows/windows-dirwatcher.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: ";"
15 changes: 15 additions & 0 deletions examples/windows/windows-gpusample.yml
Original file line number Diff line number Diff line change
@@ -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: ";"