<!--
//
// nagios-status-byhost.dtd
//
// Nagios server report in by-host format.  All timestamps contained
// within the document should be in ISO 8601 format:
//
//    [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss]±[hh]:[mm]
//
// A sample XML document appears at the end of this DTD.
//
// $Id$
//
-->


<!--
// Full server status wrapper
-->
<!ELEMENT nagios-status (
    statistics?,
    hosts?
  ) >
<!ATTLIST nagios-status
    timestamp CDATA #IMPLIED
    url CDATA #IMPLIED
  >


<!--
// Server statistics
-->
<!ELEMENT statistics (
    active_service_latency_average?,
    active_service_execution_time_average?,
    active_services_last_5_min?,
    passive_services_last_5_min?
  ) >
<!ELEMENT active_service_latency_average (#PCDATA)>
<!ELEMENT active_service_execution_time_average (#PCDATA)>
<!ELEMENT active_services_last_5_min (#PCDATA)>
<!ELEMENT passive_services_last_5_min (#PCDATA)>


<!--
// Container for all per-host reports
-->
<!ELEMENT hosts (
    host*
  ) >
<!ATTLIST hosts
    count CDATA #REQUIRED
    problems CDATA #REQUIRED
    url CDATA #IMPLIED
  >


<!--
// Per-host status information
-->
<!ELEMENT host (
    hostgroup*,
    most-recent-problem*,
    service*
  ) >
<!ATTLIST host
    id ID #REQUIRED
    status (0|1|2|-1) "0"
    problems CDATA #REQUIRED
    url CDATA #IMPLIED
  >


<!--
// Hostgroup membership
-->
<!ELEMENT hostgroup (#PCDATA)>
<!ATTLIST hostgroup
    url CDATA #IMPLIED
  >


<!--
// Per-host most recent problem; the element content is the id of the service
// in question.  Mainly added as a convenience for sorting by newest problem
// (thank to Mr. Cash)
-->
<!ELEMENT most-recent-problem (#PCDATA)>
<!ATTLIST most-recent-problem
    timestamp CDATA #REQUIRED
  >


<!--
// Service record
-->
<!ELEMENT service (
    check,
    servicegroup*,
    comment*
  ) >
<!ATTLIST service
    id ID #REQUIRED
		status (0|1|2|-1) "0"
		state_type (0|1) #IMPLIED
    url CDATA #IMPLIED
  >


<!--
// Service check information
-->
<!ELEMENT check (
    attempt,
    next_check?,
    last_state_change?,
    last_hard_state_change?,
    acknowledged?,
    plugin_output
  ) >
<!ATTLIST check
    timestamp CDATA #REQUIRED
  >


<!--
// Check attempt
-->
<!ELEMENT attempt (#PCDATA)>
<!ATTLIST attempt max CDATA #REQUIRED>


<!--
// Timestamp of the next-scheduled check of a service
-->
<!ELEMENT next_check (#PCDATA)>


<!--
// Timestamp of last state change of a service
-->
<!ELEMENT last_state_change (#PCDATA)>


<!--
// Timestamp of last _hard_ state change of a service
-->
<!ELEMENT last_hard_state_change (#PCDATA)>


<!--
// If there is a problem, has it been acknowledged?
-->
<!ELEMENT acknowledged (#PCDATA)>


<!--
// Output produced by the Nagios plugin
-->
<!ELEMENT plugin_output (#PCDATA)>


<!--
// Service group membership
-->
<!ELEMENT servicegroup (#PCDATA)>
<!ATTLIST servicegroup
    url CDATA #IMPLIED
  >


<!--
// Service comments
-->
<!ELEMENT comment (#PCDATA)>
<!ATTLIST comment
    author CDATA #IMPLIED
    timestamp CDATA #IMPLIED
  >


<!--
//
// Sample document
//
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE nagios-status
  PUBLIC "-//University of Delaware//DTD Nagios Status By-Host 1.0//EN"
  "http://www.udel.edu/DTDs/nagios-status-byhost.dtd">
<nagios-status timestamp="2008-06-20T13:15:00-00:00" url="https://gjallarhorn.nss.udel.edu/">
  <statistics>
    <active_service_latency_average>17.552 sec</active_service_latency_average>
    <active_service_execution_time_average>0.631 sec</active_service_execution_time_average>
    <active_services_last_5_min>1197</active_services_last_5_min>
    <passive_services_last_5_min>1472</passive_services_last_5_min>
  </statistics>
  <hosts count="1" problems="0" url="https://gjallarhorn.nss.udel.edu/nagios/cgi-bin/status.cgi?hostgroup=all&style=hostdetail">
    <host id="bsr.nss" status="0" problems="1" url="https://gjallarhorn.nss.udel.edu/nagios/cgi-bin/status.cgi?navbarsearch=1&host=bsr.nss">
      <hostgroup url="https://gjallarhorn.nss.udel.edu/nagios/cgi-bin/status.cgi?hostgroup=servers_all&style=overview">All Servers</hostgroup>
      <hostgroup url="https://gjallarhorn.nss.udel.edu/nagios/cgi-bin/status.cgi?hostgroup=servers_solaris&style=overview">Normal Solaris Servers</hostgroup>
      <service id="zombie processes" status="2" state_type="1" url="https://gjallarhorn.nss.udel.edu/nagios/cgi-bin/extinfo.cgi?type=2&host=bsr.nss&service=zombie+processes">
        <check timestamp="2008-06-20T15:00:00-00:00">
          <attempt max="3">3</attempt>
          <next_check>2008-06-20T16:00:00-00:00</next_check>
          <last_state_change>2008-06-20T10:00:00-00:00</last_state_change>
          <acknowledged>1</acknowledged>
          <plugin_output>CRITICAL - 12 processes running with STATE = Z</plugin_output>
        </check>
        <servicegroup url="https://gjallarhorn.nss.udel.edu/nagios/cgi-bin/status.cgi?servicegroup=zombies&style=overview">zombies</servicegroup>
        <servicegroup url="https://gjallarhorn.nss.udel.edu/nagios/cgi-bin/status.cgi?servicegroup=process_checks&style=overview">process checks</servicegroup>
        <comment author="cash" timestamp="2008-06-20T13:15:00-00:00">
          I want pudding
        </comment>
        <comment author="cash" timestamp="2008-06-20T13:20:00-00:00">
          Now I don't want pudding
        </comment>
      </service>
    </host>
  </hosts>
</nagios-status>
-->

