<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>4.0</version>
    <date>2018-12-22T16:56:57Z</date>
    <groups>
        <group>
            <name>Templates</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>Discovery Windows Service</template>
            <name>[company] Discovery Windows Service</name>
            <description>Discover windows services which are set to auto startup but are not</description>
            <groups>
                <group>
                    <name>Templates</name>
                </group>
            </groups>
            <applications/>
            <items/>
            <discovery_rules>
                <discovery_rule>
                    <name>Service Discovery</name>
                    <type>7</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>service.discovery</key>
                    <delay>5m</delay>
                    <status>0</status>
                    <allowed_hosts/>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <filter>
                        <evaltype>0</evaltype>
                        <formula/>
                        <conditions>
                            <condition>
                                <macro>{#SERVICE.STARTUP}</macro>
                                <value>^(0|1)$</value>
                                <operator>8</operator>
                                <formulaid>B</formulaid>
                            </condition>
                            <condition>
                                <macro>{#SERVICE.NAME}</macro>
                                <value>^(AppVClient|sppsvc|wsbexchange)$</value>
                                <operator>9</operator>
                                <formulaid>A</formulaid>
                            </condition>
                            <condition>
                                <macro>{#SERVICE.STARTUPTRIGGER}</macro>
                                <value>^(1)$</value>
                                <operator>9</operator>
                                <formulaid>C</formulaid>
                            </condition>
                            <condition>
                                <macro>{#SERVICE.STATE}</macro>
                                <value>^(0)$</value>
                                <operator>9</operator>
                                <formulaid>D</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <lifetime>1h</lifetime>
                    <description/>
                    <item_prototypes>
                        <item_prototype>
                            <name>Service - {#SERVICE.DISPLAYNAME} - State</name>
                            <type>7</type>
                            <snmp_community/>
                            <snmp_oid/>
                            <key>service.info[{#SERVICE.NAME}]</key>
                            <delay>5m</delay>
                            <history>3d</history>
                            <trends>1w</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units/>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <params/>
                            <ipmi_sensor/>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description/>
                            <inventory_link>0</inventory_link>
                            <applications/>
                            <valuemap>
                                <name>Windows service state</name>
                            </valuemap>
                            <logtimefmt/>
                            <preprocessing/>
                            <jmx_endpoint/>
                            <timeout>3s</timeout>
                            <url/>
                            <query_fields/>
                            <posts/>
                            <status_codes>200</status_codes>
                            <follow_redirects>1</follow_redirects>
                            <post_type>0</post_type>
                            <http_proxy/>
                            <headers/>
                            <retrieve_mode>0</retrieve_mode>
                            <request_method>0</request_method>
                            <output_format>0</output_format>
                            <allow_traps>0</allow_traps>
                            <ssl_cert_file/>
                            <ssl_key_file/>
                            <ssl_key_password/>
                            <verify_peer>0</verify_peer>
                            <verify_host>0</verify_host>
                            <application_prototypes>
                                <application_prototype>
                                    <name>Service_Startup</name>
                                </application_prototype>
                            </application_prototypes>
                            <master_item/>
                        </item_prototype>
                    </item_prototypes>
                    <trigger_prototypes>
                        <trigger_prototype>
                            <expression>{Discovery Windows Service:service.info[{#SERVICE.NAME}].last()}&lt;&gt;0</expression>
                            <recovery_mode>0</recovery_mode>
                            <recovery_expression/>
                            <name>{#SERVICE.DISPLAYNAME} Service is {#SERVICE.STATENAME} but set as {#SERVICE.STARTUPNAME}</name>
                            <correlation_mode>0</correlation_mode>
                            <correlation_tag/>
                            <url/>
                            <status>0</status>
                            <priority>1</priority>
                            <description/>
                            <type>0</type>
                            <manual_close>0</manual_close>
                            <dependencies/>
                            <tags/>
                        </trigger_prototype>
                    </trigger_prototypes>
                    <graph_prototypes/>
                    <host_prototypes/>
                    <jmx_endpoint/>
                    <timeout>3s</timeout>
                    <url/>
                    <query_fields/>
                    <posts/>
                    <status_codes>200</status_codes>
                    <follow_redirects>1</follow_redirects>
                    <post_type>0</post_type>
                    <http_proxy/>
                    <headers/>
                    <retrieve_mode>0</retrieve_mode>
                    <request_method>0</request_method>
                    <allow_traps>0</allow_traps>
                    <ssl_cert_file/>
                    <ssl_key_file/>
                    <ssl_key_password/>
                    <verify_peer>0</verify_peer>
                    <verify_host>0</verify_host>
                </discovery_rule>
            </discovery_rules>
            <httptests/>
            <macros/>
            <templates/>
            <screens/>
        </template>
    </templates>
    <value_maps>
        <value_map>
            <name>Windows service state</name>
            <mappings>
                <mapping>
                    <value>0</value>
                    <newvalue>Running</newvalue>
                </mapping>
                <mapping>
                    <value>1</value>
                    <newvalue>Paused</newvalue>
                </mapping>
                <mapping>
                    <value>2</value>
                    <newvalue>Start pending</newvalue>
                </mapping>
                <mapping>
                    <value>3</value>
                    <newvalue>Pause pending</newvalue>
                </mapping>
                <mapping>
                    <value>4</value>
                    <newvalue>Continue pending</newvalue>
                </mapping>
                <mapping>
                    <value>5</value>
                    <newvalue>Stop pending</newvalue>
                </mapping>
                <mapping>
                    <value>6</value>
                    <newvalue>Stopped</newvalue>
                </mapping>
                <mapping>
                    <value>7</value>
                    <newvalue>Unknown</newvalue>
                </mapping>
                <mapping>
                    <value>255</value>
                    <newvalue>No such service</newvalue>
                </mapping>
            </mappings>
        </value_map>
    </value_maps>
</zabbix_export>
