├── LICENSE ├── README.md ├── scripts ├── MailflowCheck │ ├── README.md │ └── ZabbixMailflowCheck.vbs └── README.md └── templates ├── DevExpress-Report-Server ├── Readme.md └── zabbix_template_DevExpress.xml ├── Exchange_2003 └── zabbix_template_Exchange_2003.xml ├── Microsoft-TeamFoundationServer ├── Readme.md └── zabbix_template_TFS.xml ├── SpectorCNE ├── zabbix_template_Spector_Client.xml └── zabbix_template_Spector_Server.xml ├── Windows-DHCPServer ├── README.md ├── check_dhcp.vbs └── zabbix_template_Microsoft_DHCP_server.xml ├── Windows-DomainController ├── README.md ├── dcdiag_check.vbs └── zabbix_template_AD_Domain_Controller.xml ├── Windows-Eventlogs └── zbx_eventlog_template.xml ├── Windows-OS └── Template_OS_Windows-2.4.7.xml ├── Windows-Updates ├── README.md ├── winupdates.vbs └── zabbix_template_windows_updates.xml └── Windows-WSUS └── zabbix_template_WSUS.xml /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | zabbix 2 | ====== 3 | 4 | A Collection of Zabbix scripts, templates and other useful stuff 5 | -------------------------------------------------------------------------------- /scripts/MailflowCheck/README.md: -------------------------------------------------------------------------------- 1 | # MailflowCheck 2 | 3 | ## About 4 | This script runs the IMAP Checker utility to get the most recent unread message from it's configured mailbox and reports the date/timestamp to the Zabbix server using the zabbix_sender process 5 | 6 | ## Requirements 7 | **Zabbix Agent For Windows** 8 | 9 | **IMAP Checker Utility** (https://github.com/DavidWGilmore/imap-checker/) 10 | 11 | **Windows 7/ Server 2008 or newer** (required by IMAP Checker) 12 | 13 | ## Configuration 14 | The following variables need to be configured before runing the script 15 | 16 | **serverName** - The IP address or hostname of your Zabbix server 17 | 18 | **hostName** - The value of the Host Name field for the given item 19 | 20 | **zbxSender** - Path to the local zabbix_sender application 21 | 22 | **imap_checker** - Path to the IMAP Checker utility 23 | 24 | For a list of epoch offset values for various timezones see http://www.epochconverter.com/epoch/timezones.php 25 | 26 | **standardTimeOffset** - Epoch offset in seconds 27 | 28 | **DSTOffset** - Epoch offset in seconds during DST 29 | -------------------------------------------------------------------------------- /scripts/MailflowCheck/ZabbixMailflowCheck.vbs: -------------------------------------------------------------------------------- 1 | '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | ' Name: ZabbixMailFlowCheck 3 | ' Version: v1.0 4 | ' Created By: David W. Gilmore 5 | ' Modified: December 9, 2014 6 | ' 7 | ' Summary: 8 | ' This script runs the imap_checker utility, gets the date of the last message, and returns it to the Zabbix server. Note that 9 | ' Epoch time is used because this is how Zabbix stores date/time values 10 | '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 11 | dim servername, hostname, zbxSender, imap_checker, objWshScriptExec, objStdOut, epoch, standardTimeOffset, DSTOffset, arrDST(1) 12 | Dim msgDate, justTheDate 13 | 14 | serverName = "1.2.3.4" 'The IP Address of the Zabbix server 15 | hostName = "myEMailHost" 'The value of the Host Name field for the given item 16 | zbxSender = "C:\bin\zabbix\bin\win32\zabbix_sender.exe" 'Path to the local zabbix_sender application 17 | imap_checker = "c:\bin\imap_checker\imap_checker.exe" 'Path to the IMAP Checker utility 18 | 19 | 'For a list of epoch offset values for various timezones see http://www.epochconverter.com/epoch/timezones.php 20 | standardTimeOffset = 28800 'Epoch offset in seconds (current value is for PST) 21 | DSTOffset = 25200 'Epoch offset in seconds during DST (current value is for PST) 22 | Dim objShell : Set objShell = WScript.CreateObject("WScript.Shell") 23 | 24 | 'Run the IMAP checker utility and return the date/time it reports 25 | Set objWshScriptExec = objShell.Exec(imap_checker) 26 | Set objStdOut = objWshScriptExec.StdOut 27 | 28 | 'Convert the date/time to epoch 29 | msgDate = CDate(objStdOut.ReadLine) 30 | epoch = date2epoch(msgDate) 31 | justTheDate = FormatDateTime(msgDate, 2) 32 | 33 | 'Determine if we are in DST and apply the desited offset 34 | If IsDST(justTheDate,arrDST) = 1 Then 35 | epoch = epoch + DSTOffset 36 | Else 37 | epoch = epoch + standardTimeOffset 38 | 39 | End If 40 | 41 | 'Update the item on the zabbix server 42 | objShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k mailflow_check -o " & epoch 43 | 44 | 'This Function converts a human readable date/time stamp to Unix Epoch time (Zabbix item requires this) 45 | function date2epoch(myDate) 46 | date2epoch = DateDiff("s", "01/01/1970 00:00:00", myDate) 47 | end function 48 | 49 | 'This function determines if a given date falls into Daylight Savings Time 50 | Function isDST(argDate, argReturn) 51 | Dim StartDate, EndDate 52 | 53 | If (Not IsDate(argDate)) Then 54 | argReturn(0) = -1 55 | argReturn(1) = -1 56 | isDST = -1 57 | Exit Function 58 | End If 59 | 60 | ' DST start date... 61 | StartDate = DateSerial(Year(argDate), 3, 1) 62 | Do While (WeekDay(StartDate) <> vbSunday) 63 | StartDate = StartDate + 1 64 | Loop 65 | StartDate = StartDate + 7 66 | 67 | ' DST end date... 68 | EndDate = DateSerial(Year(argDate), 11, 1) 69 | Do While (WeekDay(EndDate) <> vbSunday) 70 | EndDate = EndDate + 1 71 | Loop 72 | 73 | ' Finish up... 74 | isDST = 0 75 | If ((argDate >= StartDate) And (argDate < EndDate)) Then 76 | argReturn(0) = StartDate 77 | argReturn(1) = EndDate 78 | isDST = 1 79 | End If 80 | End Function -------------------------------------------------------------------------------- /scripts/README.md: -------------------------------------------------------------------------------- 1 | # Zabbix Scripts Index 2 | 3 | This is a summary of the scripts hosted in this reposititory. See individual READMEs for more detail 4 | 5 | [MailflowCheck](https://github.com/DavidWGilmore/zabbix/scripts/mailflowcherk) - Runs the imap_checker utility and sends the results to the Zabbix server 6 | -------------------------------------------------------------------------------- /templates/DevExpress-Report-Server/Readme.md: -------------------------------------------------------------------------------- 1 | DevExpress Report Server is a platfoirm for running reports in an ASP.Net environment. 2 | 3 | This template monitors the REport Server IIS site (default port 83) and the Task Scheduler service 4 | -------------------------------------------------------------------------------- /templates/DevExpress-Report-Server/zabbix_template_DevExpress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.2 4 | 2019-11-04T22:12:36Z 5 | 6 | 7 | Templates/Applications 8 | 9 | 10 | 11 | 152 | 153 | 154 | 155 | {Template DevExpress Report Server:net.tcp.port[,83].last()}=0 156 | 0 157 | 158 | DevExpress Reporting Service Is Unavailable 159 | 0 160 | 161 | 162 | 0 163 | 2 164 | 165 | 0 166 | 0 167 | 168 | 169 | 170 | 171 | {Template DevExpress Report Server:service.info[DevExpress.TaskScheduler,state].last()}<>0 172 | 0 173 | 174 | DevExpress Task Scheduler Not Running 175 | 0 176 | 177 | 178 | 0 179 | 3 180 | 181 | 0 182 | 0 183 | 184 | 185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /templates/Exchange_2003/zabbix_template_Exchange_2003.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2015-03-11T22:04:10Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 723 | 724 | 725 | 726 | {Template Exchange 2003:service_state[MSExchangeMGMT].last()}<>0 727 | Exchange Management Service Not Running 728 | 729 | 0 730 | 4 731 | 732 | 0 733 | 734 | 735 | 736 | {Template Exchange 2003:service_state[IMAP4Svc].last()}<>0 737 | IMAP Service Not Running 738 | 739 | 0 740 | 3 741 | 742 | 0 743 | 744 | 745 | 746 | {Template Exchange 2003:service_state[MSExchangeIS].last()}<>0 747 | Information Store Service Not Running 748 | 749 | 0 750 | 4 751 | 752 | 0 753 | 754 | 755 | 756 | {Template Exchange 2003:service_state[MSExchangeMTA].last()}<>0 757 | MTA Service Not Running 758 | 759 | 0 760 | 4 761 | 762 | 0 763 | 764 | 765 | 766 | {Template Exchange 2003:service_state[RESvc].last()}<>0 767 | Routing Engine Service Not Running 768 | 769 | 0 770 | 4 771 | 772 | 0 773 | 774 | 775 | 776 | {Template Exchange 2003:service_state[MSExchangeSA].last()}<>0 777 | System Attendant Service Not Running 778 | 779 | 0 780 | 4 781 | 782 | 0 783 | 784 | 785 | 786 | 787 | -------------------------------------------------------------------------------- /templates/Microsoft-TeamFoundationServer/Readme.md: -------------------------------------------------------------------------------- 1 | This template is created to monitor a Microsoft Team Foundation Server that was installed using the Standalone install method. If you are using a Standard SQL Server instance you might want to use a different template for that. 2 | -------------------------------------------------------------------------------- /templates/Microsoft-TeamFoundationServer/zabbix_template_TFS.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.2 4 | 2019-11-06T22:26:36Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 398 | 399 | 400 | 401 | {Template Microsoft Team Foundation Server:net.tcp.listen[443].last()}<>1 402 | 0 403 | 404 | HTTPS Connections Unavailable 405 | 0 406 | 407 | 408 | 0 409 | 2 410 | 411 | 0 412 | 0 413 | 414 | 415 | 416 | 417 | {Template Microsoft Team Foundation Server:service_state[IISAdmin].last()}<>0 418 | 0 419 | 420 | IIS Admin Service Not Running 421 | 0 422 | 423 | 424 | 0 425 | 2 426 | 427 | 0 428 | 0 429 | 430 | 431 | 432 | 433 | {Template Microsoft Team Foundation Server:service_state[TFSJobAgent].last()}<>0 434 | 0 435 | 436 | TFS background Job Agent Service Not Running 437 | 0 438 | 439 | 440 | 0 441 | 2 442 | 443 | 0 444 | 0 445 | 446 | 447 | 448 | 449 | {Template Microsoft Team Foundation Server:net.tcp.listen[8080].last()}<>1 450 | 0 451 | 452 | TFS Check-In Service Unavailable 453 | 0 454 | 455 | 456 | 0 457 | 2 458 | 459 | 0 460 | 0 461 | 462 | 463 | 464 | 465 | {Template Microsoft Team Foundation Server:service_state[W3SVC].last()}<>0 466 | 0 467 | 468 | World Wide Web Publishing Service Not Running 469 | 0 470 | 471 | 472 | 0 473 | 2 474 | 475 | 0 476 | 0 477 | 478 | 479 | 480 | 481 | 482 | 483 | Windows service state 484 | 485 | 486 | 0 487 | Running 488 | 489 | 490 | 1 491 | Paused 492 | 493 | 494 | 2 495 | Start pending 496 | 497 | 498 | 3 499 | Pause pending 500 | 501 | 502 | 4 503 | Continue pending 504 | 505 | 506 | 5 507 | Stop pending 508 | 509 | 510 | 6 511 | Stopped 512 | 513 | 514 | 7 515 | Unknown 516 | 517 | 518 | 255 519 | No such service 520 | 521 | 522 | 523 | 524 | 525 | -------------------------------------------------------------------------------- /templates/SpectorCNE/zabbix_template_Spector_Client.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2015-03-11T22:06:18Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 75 | 76 | 77 | 78 | {Template Spector Client:service_state[System Event Dispatcher].last()}<>0 79 | Spector Not Running 80 | 81 | 0 82 | 2 83 | 84 | 0 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /templates/SpectorCNE/zabbix_template_Spector_Server.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2015-03-11T22:08:24Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 161 | 162 | 163 | 164 | {Template Spector Server:service_state[SPCEAdminSvc].last()}<>0 165 | Spector Control Center Server Service Not Running 166 | 167 | 0 168 | 2 169 | 170 | 0 171 | 172 | 173 | 174 | {Template Spector Server:service_state[SPDataServer].last()}<>0 175 | Spector Data Valut Service Not Running 176 | 177 | 0 178 | 2 179 | 180 | 0 181 | 182 | 183 | 184 | {Template Spector Server:service_state[SPLicenseManager].last()}<>0 185 | Spector Primary Server Service Not Running 186 | 187 | 0 188 | 2 189 | 190 | 0 191 | 192 | 193 | 194 | 195 | -------------------------------------------------------------------------------- /templates/Windows-DHCPServer/README.md: -------------------------------------------------------------------------------- 1 | Windows-DHCP 2 | ====== 3 | Based on the script written by Marco Gottardello from http://atsoy.blogspot.com/2010/06/vbs-script-check-dhcp-state.html 4 | 5 | Usage 6 | 7 | 1. Place check_dhcp.vbs in the zabbix script directory of your DHCP server 8 | 2. Add a dhcp.free UserParameter to the DHCP server's config like this: UserParameter=dhcp.free,cscript.exe //Nologo c:\bin\zabbix\scripts\check_dhcp.vbs 9 | -------------------------------------------------------------------------------- /templates/Windows-DHCPServer/check_dhcp.vbs: -------------------------------------------------------------------------------- 1 | '============================================================== 2 | ' 3 | ' Script: check_dhcp_scope.vbs 4 | ' 5 | ' Autore: Marco Gottardello - marco@gottardello.net 6 | ' 7 | ' Data: 26/01/2010 8 | ' 9 | ' Descrizione: Check the health status of scopes on the local DHCP server 10 | ' 11 | ' History: v1.0 : first version 12 | ' 13 | '============================================================== 14 | 15 | 16 | Set objFSO = CreateObject("Scripting.FileSystemObject") 17 | Set tfolder = objfso.GetSpecialFolder(2) 18 | 19 | filetoparse= tfolder&"\EXPORT_DHCP_SCOPE.TXT" 20 | 21 | bdebug=FALSE 22 | 23 | strout="" 24 | 25 | Critical_Limit=0 26 | Warning_Limit=4 27 | 28 | function parse(strtoparse) 29 | parse=mid(strtoparse,instr(strtoparse,"=")+2,len(strtoparse)-instr(strtoparse,"=")-2) 30 | end function 31 | 32 | 33 | '=========main============= 34 | 35 | strthecommand="cmd.exe /c netsh dhcp server show all > "&filetoparse&" 2>&1" 36 | CreateObject("WScript.Shell").Run (strthecommand),0,true 37 | WScript.Sleep(5000) 38 | 39 | 40 | ScopeCount=0 41 | ScopeOk=0 42 | ScopeDisabled=0 43 | ScopeWarning=0 44 | ScopeCritical=0 45 | 46 | 47 | Const ForReading = 1 48 | Const ForWriting = 2 49 | Const ForAppending = 8 50 | 51 | 52 | 'apro i file sorgente 53 | Set objFileSorg = objFSO.OpenTextFile(filetoparse, ForReading) 54 | 55 | oldstr2="" 56 | oldstr3="" 57 | oldstr="" 58 | 59 | Do While objFileSorg.AtEndOfStream <> True 60 | strSorg = objFileSorg.ReadLine 61 | if instr(oldstr2,"Subnet") then 62 | scopecount=scopecount+1 63 | 64 | SubnetIP=parse(oldstr2) 65 | FreeIP=parse(strsorg) 66 | UsedIP=parse(oldstr) 67 | 68 | if bdebug then wscript.echo SubnetIP&" "&UsedIP&" "&FreeIP 69 | 70 | if UsedIP=0 then 71 | if bdebug then wscript.echo "-"&SubnetIP&" is disabled" 72 | ScopeDisabled=ScopeDisabled+1 73 | elseif int(FreeIP)<=Critical_Limit then 74 | if bdebug then wscript.echo "-"&SubnetIP&" is Critical ("&FreeIP&" free)" 75 | StrOut=Strout&SubnetIP&" is Critical ("&FreeIP&" free). " 76 | ScopeCritical=ScopeCritical+1 77 | elseif int(FreeIP)<=Warning_Limit then 78 | if bdebug then wscript.echo "-"&SubnetIP&" is Warning ("&FreeIP&" free)" 79 | StrOut=Strout&SubnetIP&" is Warning ("&FreeIP&" free). " 80 | ScopeWarning=ScopeWarning+1 81 | end if 82 | 83 | end if 84 | 85 | oldstr3=oldstr2 86 | oldstr2=oldstr 87 | oldstr=strsorg 88 | loop 89 | objFileSorg.Close 90 | 91 | if not strout="" then wscript.echo strout 92 | 93 | if ScopeCritical then wscript.quit(2) 94 | if ScopeWarning then wscript.quit(1) 95 | wscript.echo FreeIP 96 | wscript.quit(0) -------------------------------------------------------------------------------- /templates/Windows-DHCPServer/zabbix_template_Microsoft_DHCP_server.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2015-12-10T09:59:11Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 462 | 463 | 464 | 465 | {Template_Microsoft_DHCP_Server:dhcp.free.last()}<3 466 | DHCP: Free IPs Low 467 | 468 | 0 469 | 2 470 | 471 | 0 472 | 473 | 474 | 475 | {Template_Microsoft_DHCP_Server:service_state[DHCPServer].last(0)}<>0 476 | DHCP server not running 477 | 478 | 0 479 | 4 480 | 481 | 0 482 | 483 | 484 | 485 | 486 | -------------------------------------------------------------------------------- /templates/Windows-DomainController/README.md: -------------------------------------------------------------------------------- 1 | Windows-DomainController 2 | ====== 3 | This template checks various Performance monitors and services associated with Active Directory, as well as running the dcdiag tool to assess AD health 4 | 5 | Usage 6 | 7 | 1. Place dcdiag_check.vbs in the zabbix script directory of your DHCP server 8 | 2. Add the following line to UserParameter section of the Comain Controller's config and point it to the script like this: dcdiag[*],cscript //Nologo C:\bin\Zabbix\scripts\dcdiag_check.vbs $1 9 | -------------------------------------------------------------------------------- /templates/Windows-DomainController/dcdiag_check.vbs: -------------------------------------------------------------------------------- 1 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | 'dcdiag_check.vbs 3 | 'Version 1.0 4 | 'Written By: David W. Gilmore 5 | 'Created On: 03/10/2015 6 | ' 7 | ' 8 | 'Purpose: Run the specified dcdiag.exe test as specified from the command line parameter and returns 9 | ' pass or fail status. The test returns 1 for pass and 0 for fail 10 | ' 11 | 12 | 'THis is the function that runs the dcdiag test 13 | Function runDiagTest(strTest) 14 | strResult = "0" 15 | cmd = "cmd.exe /c dcdiag /test:" & strTest 16 | Set sh = WScript.CreateObject("WScript.Shell") 17 | Set exec = sh.Exec(cmd) 18 | Do While exec.Status = 0 19 | do While not Exec.StdOut.AtEndOfStream 20 | tmpLine = lcase(exec.StdOut.ReadLine()) 21 | if instr(tmpLine, lcase(strOK) & " test " & strTest) then 22 | 'we have a strOK String which means we have reached the end of a result output (maybe on newline) 23 | strResult = "1" 24 | end if 25 | Loop 26 | Loop 27 | runDiagTest = strResult 28 | End Function 29 | 30 | 'Lang dependend. Default is english 31 | dim strOK : strOK = "passed" 32 | dim strNotOK : strNotOk = "failed" 33 | 34 | 'Main execution section 35 | 36 | 'Set the test name based on the command line parameter 37 | strOption = WScript.Arguments(0) 38 | strTestResult = runDiagTest(strOption) 39 | 40 | wscript.echo strTestResult 41 | 42 | -------------------------------------------------------------------------------- /templates/Windows-DomainController/zabbix_template_AD_Domain_Controller.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2015-03-11T22:21:01Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 882 | 883 | 884 | 885 | {Template_AD_Domain_Controller:dcdiag[advertising].str(OK)}<>1 886 | DCDiag: Advertising Check Failed 887 | 888 | 0 889 | 2 890 | 891 | 0 892 | 893 | 894 | 895 | {Template_AD_Domain_Controller:dcdiag[fsmocheck].str(OK)}<>1 896 | DCDiag: FSMO Check Failed 897 | 898 | 0 899 | 2 900 | 901 | 0 902 | 903 | 904 | 905 | {Template_AD_Domain_Controller:dcdiag[machineaccount].str(OK)}<>1 906 | DCDiag: Machine Account Check Failed 907 | 908 | 0 909 | 2 910 | 911 | 0 912 | 913 | 914 | 915 | {Template_AD_Domain_Controller:dcdiag[replications].str(OK)}<>1 916 | DCDiag: Replication Check Failed 917 | 918 | 0 919 | 2 920 | 921 | 0 922 | 923 | 924 | 925 | {Template_AD_Domain_Controller:dcdiag[ridmanager].str(OK)}<>1 926 | DCDiag: RID Manager Check Failed 927 | 928 | 0 929 | 2 930 | 931 | 0 932 | 933 | 934 | 935 | {Template_AD_Domain_Controller:dcdiag[services].str(OK)}<>1 936 | DCDiag: Services Check Failed 937 | 938 | 0 939 | 2 940 | 941 | 0 942 | 943 | 944 | 945 | {Template_AD_Domain_Controller:eventlog[DFS Replication,,"Warning|Error|Failure",,,,].logseverity()}>1 and {Template_AD_Domain_Controller:eventlog[DFS Replication,,"Warning|Error|Failure",,,,].nodata(60)}<>1 946 | DFS Replication Log Error 947 | 948 | 0 949 | 1 950 | 951 | 0 952 | 953 | 954 | 955 | {Template_AD_Domain_Controller:eventlog[Directory Service,,"Warning|Error|Failure",,,,].logseverity()}>1 and {Template_AD_Domain_Controller:eventlog[Directory Service,,"Warning|Error|Failure",,,,].nodata(60)}<>1 956 | Directory Service Log Error 957 | 958 | 0 959 | 1 960 | 961 | 0 962 | 963 | 964 | 965 | {Template_AD_Domain_Controller:eventlog[DNS Server,,"Warning|Error|Failure",,,,].logseverity()}>1 and {Template_AD_Domain_Controller:eventlog[DNS Server,,"Warning|Error|Failure",,,,].nodata(60)}<>1 966 | DNS Server Log Error 967 | 968 | 0 969 | 1 970 | 971 | 0 972 | 973 | 974 | 975 | {Template_AD_Domain_Controller:eventlog[File Replication Service,,"Warning|Error|Failure",,,,].logseverity()}>1 and {Template_AD_Domain_Controller:eventlog[File Replication Service,,"Warning|Error|Failure",,,,].nodata(60)}<>1 976 | File Replication Service Log Error 977 | 978 | 0 979 | 1 980 | 981 | 0 982 | 983 | 984 | 985 | {Template_AD_Domain_Controller:service_state[DNS].avg(300)}>0 986 | Service "DNS Server" Down 987 | 988 | 0 989 | 3 990 | 991 | 0 992 | 993 | 994 | 995 | {Template_AD_Domain_Controller:service_state[kdc].last(0)}<>0 996 | Service "KDC" down 997 | 998 | 0 999 | 3 1000 | Service "KDC" on host has been down (stopped or paused) for up to 5 minutes. 1001 | 0 1002 | 1003 | 1004 | 1005 | {Template_AD_Domain_Controller:service_state[Netlogon].avg(300)}>0 1006 | Service "Netlogon" Down 1007 | 1008 | 0 1009 | 3 1010 | 1011 | 0 1012 | 1013 | 1014 | 1015 | {Template_AD_Domain_Controller:service_state[RpcSs].avg(300)}>0 1016 | Service "Remote Procedure Call (RPC)" Down 1017 | 1018 | 0 1019 | 3 1020 | 1021 | 0 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | DC Authentications/sec 1028 | 500 1029 | 250 1030 | 0.0000 1031 | 100.0000 1032 | 0 1033 | 1 1034 | 0 1035 | 1 1036 | 0 1037 | 0.0000 1038 | 0.0000 1039 | 0 1040 | 0 1041 | 0 1042 | 0 1043 | 1044 | 1045 | 0 1046 | 0 1047 | 00BB00 1048 | 0 1049 | 2 1050 | 0 1051 | 1052 | Template_AD_Domain_Controller 1053 | perf_counter[\NTDS\Kerberos Authentications, 300] 1054 | 1055 | 1056 | 1057 | 1 1058 | 0 1059 | 6666FF 1060 | 0 1061 | 2 1062 | 0 1063 | 1064 | Template_AD_Domain_Controller 1065 | perf_counter[\NTDS\NTLM Authentications, 300] 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | -------------------------------------------------------------------------------- /templates/Windows-Eventlogs/zbx_eventlog_template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2014-12-24T17:45:44Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 118 | 119 | 120 | 121 | {Template Windows Event Logs:eventlog[Application,,"Warning|Error|Failure",,,,].logseverity()}>1 and {Template Windows Event Logs:eventlog[Application,,"Warning|Error|Failure",,,,].nodata(60)}<>1 122 | Windows Application Log Error 123 | 124 | 0 125 | 2 126 | 127 | 0 128 | 129 | 130 | 131 | {Template Windows Event Logs:eventlog[System,,"Warning|Error|Failure",,,,].logseverity()}>1 and {Template Windows Event Logs:eventlog[System,,"Warning|Error|Failure",,,,].nodata(60)}<>1 132 | Windows System Log Error 133 | 134 | 0 135 | 2 136 | 137 | 0 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /templates/Windows-Updates/README.md: -------------------------------------------------------------------------------- 1 | Windows-Updates 2 | ====== 3 | This template checks to see how many Important and Optional updates need to be installed. Can be used 4 | in an environment using WSUS or retrieving updates directly from Microsoft 5 | 6 | Usage 7 | 8 | 1. Place winupdates.vbs on the Windows machine you wish to monitor 9 | 2. Configure the serverName variable with the IP of your Zabbix server 10 | 3. Configure the zbxSender variable with the path to zabbix_sender.exe 11 | 4. Configure the script to run as a scheduled task 12 | -------------------------------------------------------------------------------- /templates/Windows-Updates/winupdates.vbs: -------------------------------------------------------------------------------- 1 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 2 | 'Winupdates.vbs 3 | 'Version 1.1 4 | 'Written By: Dave Gilmore 5 | 'Created On: 02/27/2015 6 | ' 7 | ' 8 | 'Purpose: Given a class of update (high or important) returns a count of the updates waiting 9 | ' to be installed. Will also return reboot status 10 | ' 11 | ' CHANGELOG 12 | ' v1.1 13 | ' - Cleaned up the code a bit 14 | ' - hostName is now dynamically generated and does not have to be hard coded into the script 15 | 16 | Function ReturnUpdateCount(updateType) 17 | Set updateSession = CreateObject("Microsoft.Update.Session") 18 | Set updateSearcher = updateSession.CreateupdateSearcher() 19 | 20 | Select Case updateType 21 | Case "high" 22 | Set searchResult = updateSearcher.Search("IsAssigned=1 and IsHidden=0 and IsInstalled=0 and Type='Software'") 23 | Case "optional" 24 | Set searchResult = updateSearcher.Search("IsAssigned=0 and IsInstalled=0 and Type='Software'") 25 | End Select 26 | ReturnUpdateCount = searchResult.Updates.Count 27 | 28 | End Function 29 | 30 | Function RebootCheck 31 | Set objSysInfo = CreateObject("Microsoft.Update.SystemInfo") 32 | RebootCheck = objSysinfo.RebootRequired 33 | End Function 34 | 35 | Set wshNetwork = WScript.CreateObject( "WScript.Network" ) 36 | hostName = wshNetwork.ComputerName 37 | serverName = "1.2.3.4" 38 | zbxSender = "C:\bin\zabbix\bin\win32\zabbix_sender.exe" 39 | Set WSHShell = CreateObject("WScript.Shell") 40 | 41 | updatesHigh = ReturnUpdateCount("high") 42 | updatesOptional = ReturnUpdateCount("optional") 43 | strRebootRequired = RebootCheck 44 | 45 | WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[high] -o " & updatesHigh 46 | 47 | WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[optional] -o " & updatesOptional 48 | 49 | WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[reboot] -o " & strRebootRequired 50 | 51 | WScript.Quit 0 52 | -------------------------------------------------------------------------------- /templates/Windows-Updates/zabbix_template_windows_updates.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2015-03-11T22:20:42Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 161 | 162 | 163 | 164 | {Template Windows Updates:win_updates[reboot].last()}=1 165 | Reboot Required 166 | 167 | 0 168 | 2 169 | 170 | 0 171 | 172 | 173 | 174 | {Template Windows Updates:win_updates[high].last()}>0 175 | Updates Need Installing (High) 176 | 177 | 0 178 | 2 179 | 180 | 0 181 | 182 | 183 | 184 | {Template Windows Updates:win_updates[optional].last()}>0 185 | Updates Need Installing (Optional) 186 | 187 | 0 188 | 2 189 | 190 | 0 191 | 192 | 193 | 194 | 195 | -------------------------------------------------------------------------------- /templates/Windows-WSUS/zabbix_template_WSUS.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2015-03-11T21:59:45Z 5 | 6 | 7 | Templates 8 | 9 | 10 | 11 | 118 | 119 | 120 | 121 | {Template App WSUS:service_state[MSSQL$MICROSOFT##SSEE].last()}<>0 122 | Internal Database Service Not Running 123 | 124 | 0 125 | 2 126 | 127 | 0 128 | 129 | 130 | 131 | {Template App WSUS:service_state[WsusService].last()}<>0 132 | Update Service Not Running 133 | 134 | 0 135 | 2 136 | 137 | 0 138 | 139 | 140 | 141 | 142 | --------------------------------------------------------------------------------