This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select count(*) FROM (select distinct h.hostid, h.host, t.description from triggers t | |
join functions f on f.triggerid = t.triggerid | |
join items i on i.itemid = f.itemid | |
join hosts h on h.hostid = i.hostid | |
join hosts_groups hg on h.hostid = hg.hostid | |
join hstgrp hg2 on hg2.groupid = hg.groupid | |
where | |
-- value=1 - trigger is in problem state | |
t.value = 1 and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// run wmi.getall[root\cimv2,"select * from win32_networkadapter where PhysicalAdapter=True"] | |
// this filters other performance metric counters, so Discard can be applied. | |
output = JSON.parse(value).map(function(net){ | |
return { | |
"{#IFNAME}": net.Name, | |
"{#IFDESCR}": net.Description, | |
"{#IFPHYSICALADAPTER}": net.PhysicalAdapter, | |
"{#IFALIAS}": net.NetConnectionID, | |
"{#IFNETENABLED}": net.NetEnabled | |
}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Performs rDNS check using 'host' command | |
if [[ $# -eq 0 ]] ; then | |
echo 'You must provide DNS record as the first argument' | |
exit 0 | |
fi | |
function lookup(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (parseFloat(app.version) > 6) | |
main(); | |
else | |
app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Color Textboxes Based on Word"); | |
function main() { | |
var red = app.activeDocument.colors.itemByName("RGB Red"); | |
var blue = app.activeDocument.colors.itemByName("RGB Blue"); | |
var sel = app.selection; | |
for(s=0;s<sel.length;s++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UserParameter=u.ping[*],/bin/ping -c 1 -W 1 -q -n $1 &> /dev/null && echo 1 || echo 0 | |
UserParameter=u.ping.avg[*],/bin/ping -c $2 -s $3 -W 1 -q -n $1 | tail -1 | awk -F '/' '{print $$5}' | |
UserParameter=u.ping.loss[*],/bin/ping -c $2 -s $3 -W 1 -q -n $1 | grep -oP '[0-9]+% packet loss' | cut -d'%' -f1 | |
#sample key: | |
#u.ping.loss[10.77.248.165,5,100] | |
#Last octet only | |
#example keys: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'KNOWN ISSUE: If Application name conatins '-' symbol then e-mail alert containing software list will be sent all on one line instead of each packet on a single line | |
variable=InstalledApplications(".") | |
'WScript.Echo strConvert(variable,"Windows-1251","cp866") | |
Const ForReading = 1 | |
zabbix_dir="C:\zabbix\" | |
Set objFSO = CreateObject("Scripting.FileSystemObject") | |
'Create old file if does not exist | |
If objFSO.FileExists(zabbix_dir&"uDiffPrograms_old.txt")=0 Then | |
Set objFile4 = objFSO.CreateTextFile(zabbix_dir&"uDiffPrograms_old.txt") | |
objFile4.WriteLine variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; InfluxDB database details where Riemann will store the data. Setup :username and :password | |
;; if you added security step behind riemann database access. | |
(def influxdb-creds { | |
:version :0.9 | |
:host "localhost" | |
:port 8086 | |
:db "riemann" | |
; :username "riemann" | |
; :password "riemann" | |
}) |