5.2. Functional Specification

We have to different communications between agent and two different backend servers, the data collector and the configuration server.

5.2.1.  Functional Specification for communication between agent and data collector

Example 5.1. XML text send from agent to data collector

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE OPENSMARTRESPONSE SYSTEM "opensmartresponse.dtd">

<OPENSMARTRESPONSE>
  <CHECKDATA>
    <NAME>PROC</NAME>
    <TIMESTAMP>2004.04.11.15.50.43</TIMESTAMP>
    <HOST>ostestserver</HOST>
    <ERRORLIST>
      <ERROR>
        <ERRORLEVEL>NORMAL</ERRORLEVEL>
        <CHECKPOINT>sendmail</CHECKPOINT>
        <DETAILS>Running instances of sendmail: 1/1 (  561 )</DETAILS>
      </ERROR>
      <ERROR>
        <ERRORLEVEL>WARNING</ERRORLEVEL>
        <CHECKPOINT>httpd</CHECKPOINT>
        <DETAILS>Running instances of httpd: 0/1 ()</DETAILS>
      </ERROR>
    </ERRORLIST>
  </CHECKDATA><CHECKDATA>
    <NAME>DISK</NAME>
    <TIMESTAMP>2004.04.11.15.50.43</TIMESTAMP>
    <HOST>ostestserver</HOST>
    <ERRORLIST>
      <ERROR>
        <ERRORLEVEL>NORMAL</ERRORLEVEL>
        <CHECKPOINT>/</CHECKPOINT>
      </ERROR>
      <ERROR>
        <ERRORLEVEL>WARNING</ERRORLEVEL>
        <CHECKPOINT>/home</CHECKPOINT>
        <DETAILS>Used: 8182464, Total: 9612004, Percent: 85, Threshold: 58</DETAILS>
      </ERROR>
    </ERRORLIST>
  </CHECKDATA>
</OPENSMARTRESPONSE>
            

The DTD for this XML text can be found under "opensmartresponse.dtd" (in CVS or in ~osmart/etc ):

          <?xml version="1.0" encoding="ISO-8859-1"?>

<!-- ============================================================= -->
<!--                   OPENSMARTRESPONSE.dtd                       -->
<!-- $Id: opensmartresponse.dtd 2108 2007-11-10 05:30:17Z uherbst $       -->
<!-- Author: uherbst                                               -->
<!--                                                               -->
<!-- How report agents check results and performance data to the   -->
<!-- OpenSMART collector server                                    -->
<!-- ============================================================= -->

<!--          OpenSMARTResponse                                    -->
<!--          Main Tag for OpenSMART-monitoring.dtd                -->
<!ELEMENT  OPENSMARTRESPONSE
                        (CHECKDATA|REPORTDATA)+                      >


<!--          CHECKDATA                                            -->
<!--          This is the response for non-reporting checks
              like uptime-checks or running service checks.        -->
<!ELEMENT  CHECKDATA    (
                          NAME,
                          TIMESTAMP,
                          HOST,
                          ERRORLIST
                        )                                            >

<!--          NAME, TIMESTAMP, HOST                                -->
<!--          Which check, when and on which host ?                -->
<!ELEMENT  NAME         (#PCDATA)                                    >
<!ELEMENT  TIMESTAMP    (#PCDATA)                                    >
<!ELEMENT  HOST         (#PCDATA)                                    >

<!--          ERRORLIST                                            -->
<!--          Which errors ?                                       -->
<!ELEMENT  ERRORLIST    (ERROR)*                                     >

<!--          ERROR                                                -->
<!--          Description of one error                             -->
<!ELEMENT  ERROR        (CHECKPOINT,
                         ERRORLEVEL,
                         DETAILS?,
                         DESCRIPTION?,
                         STATUS?)                                    >

<!--          ERRORLEVEL, CHECKPOINT, DETAIL                       -->
<!--          Details of an error                                  -->
<!ELEMENT  ERRORLEVEL   (#PCDATA)                                    >
<!ELEMENT  CHECKPOINT   (#PCDATA)                                    >
<!ELEMENT  STATUS       (#PCDATA)                                    >
<!ELEMENT  DETAILS      (#PCDATA)                                    >

<!--          REPORTDATA                                           -->
<!--          This is the response for reporting checks like
              diskspace or cpu statistics.                         -->
<!-- FIXME: This ELEMENT isn't complete yet!                       -->
<!ELEMENT  REPORTLIST    (REPORTDATA)*                               >
<!ELEMENT  REPORTDATA    (DATA1,DATA2,DATA3,DATA4,DATA5,DATA6,DATA7,
			  DATA8,DATA9.DATA10,DATA11,DATA12,DATA13,
			  DATA14,DATA15,DESCRIPTOR)		     >
<!--								     >
<!ELEMENT  DATA1         (#PCDATA)                                   >
<!ELEMENT  DATA2         (#PCDATA)                                   >
<!ELEMENT  DATA3         (#PCDATA)                                   >
<!ELEMENT  DATA4         (#PCDATA)                                   >
<!ELEMENT  DATA5         (#PCDATA)                                   >
<!ELEMENT  DATA6         (#PCDATA)                                   >
<!ELEMENT  DATA7         (#PCDATA)                                   >
<!ELEMENT  DATA8         (#PCDATA)                                   >
<!ELEMENT  DATA9         (#PCDATA)                                   >
<!ELEMENT  DATA10        (#PCDATA)                                   >
<!ELEMENT  DATA11        (#PCDATA)                                   >
<!ELEMENT  DATA12        (#PCDATA)                                   >
<!ELEMENT  DATA13        (#PCDATA)                                   >
<!ELEMENT  DATA14        (#PCDATA)                                   >
<!ELEMENT  DATA15        (#PCDATA)                                   >
<!ELEMENT  DESCRIPTOR    (DATA1,DATA2,DATA3,DATA4,DATA5,DATA6,DATA7,
			  DATA8,DATA9.DATA10,DATA11,DATA12,DATA13,
			  DATA14,DATA15)			     >


        

5.2.2.  Functional Specification for communication between agent and configuration server

You haven't to use a configuration server, you can just put the config file to ~osmart/etc/osagent.conf.xml . Anyway, osagent.conf.xml has to be valid XML. A description for all tags is given in the User- and Installation-Guide here. The DTD looks like:

          <?xml version="1.0" encoding="ISO-8859-1"?>

<!-- ============================================================= -->
<!--                          agent.dtd                            -->
<!-- $Id: osagentconfig.dtd 2888 2009-09-21 16:15:22Z hoschult $ -->
<!-- $Author: hoschult $ -->
<!-- $Version$ -->
<!--                                                               -->
<!-- this dtd describes the osagent.conf.xml files                 -->
<!-- ============================================================= -->


<!-- ============================================================= -->
<!--          all checks are listed here:                          -->
<!--                                                               -->
<!ELEMENT OSAGENT
    (OSAGENTCONFIG, SIMPLE?, DISK?, PROC?, MAILQ?, PING?, LOGS?,
     SOCKETS?, WEBAPP?, LPD?, AIXSWRAID?, ERRPT?, EVENTLOG?,
     HPARRAY?, LOAD?, LDAP?, ORATS?, LXSWRAID?, SUNSWRAID?, SWAP?,
     ORATNSPING?, MYSQL?, TOMCAT?, ORASESSIONS?, DB2TS?, DNS?, ORALCK?,
     NTP-REMOTE?, DNS?, HYLAFAX?, DB2APPLICATIONS?, DB2CONNECT?,
     XEN?, FTP?, SMTP?, SNMP?, SOAP?, WEBSPHERE?, SERVICES?,
     READFILE?, DB2LCK?, NBU )>
<!-- ============================================================= -->

<!ENTITY % COMMONDEF   		SYSTEM "commontags.dtd"              >
%COMMONDEF;

<!ENTITY % SIMPLETAGS		SYSTEM "simple.dtd"                  >
%SIMPLETAGS;

<!ENTITY % DISKTAGS    		SYSTEM "disk.dtd"                    >
%DISKTAGS;

<!ENTITY % DB2TSTAGS  		SYSTEM "db2ts.dtd"                   >
%DB2TSTAGS;

<!ENTITY % DB2APPLICATIONSTAGS  SYSTEM "db2applications.dtd"         >
%DB2APPLICATIONSTAGS;

<!ENTITY % DB2CONNECTTAGS       SYSTEM "db2connect.dtd"              >
%DB2CONNECT;

<!ENTITY % DB2LCKTAGS           SYSTEM "db2lck.dtd"                  >
%DB2LCKTAGS;;

<!ENTITY % DNSTAGS  		SYSTEM "dns.dtd"                     >
%DNSTAGS;

<!ENTITY % EVENTLOGTAGS         SYSTEM "eventlog.dtd"                >
%EVENTLOGTAGS;

<!ENTITY % PROCTAGS		SYSTEM "proc.dtd"                    >
%PROCTAGS;

<!ENTITY % MAILQTAGS  		SYSTEM "mailq.dtd"                   >
%MAILQTAGS;

<!ENTITY % PINGTAGS   		SYSTEM "ping.dtd"                    >
%PINGTAGS;

<!ENTITY % LOGSTAGS		SYSTEM "logs.dtd"                    >
%LOGSTAGS;

<!ENTITY % SOCKETS   		SYSTEM "sockets.dtd"                 >
%SOCKETS;

<!ENTITY % SERVICES   		SYSTEM "services.dtd"                >
%SERVICES;

<!ENTITY % HPARRAY   		SYSTEM "hparray.dtd"                 >
%HPARRAY;

<!ENTITY % ERRPTTAGS   		SYSTEM "errpt.dtd"                   >
%ERRPTTAGS;

<!ENTITY % WEBAPPTAGS		SYSTEM "webapp.dtd"                  >
%WEBAPPTAGS;

<!ENTITY % LPDTAGS   		SYSTEM "lpd.dtd"	             >
%LPDTAGS;

<!ENTITY % AIXSWRAIDTAGS	SYSTEM "aixswraid.dtd"               >
%AIXSWRAIDTAGS;

<!ENTITY % LOADTAGS             SYSTEM "load.dtd"                    >
%LOADTAGS;

<!ENTITY % LDAPTAGS             SYSTEM "ldap.dtd"                    >
%LDAPTAGS;

<!ENTITY % ORATSTAGS            SYSTEM "orats.dtd"                   >
%ORATSTAGS;

<!ENTITY % ORALCKTAGS           SYSTEM "oralck.dtd"                  >
%ORALCKTAGS;

<!ENTITY % LXSWRAIDTAGS         SYSTEM "lxswraid.dtd"                >
%LXSWRAIDTAGS;

<!ENTITY % ORATNSTAGS           SYSTEM "oratns.dtd"                  >
%ORATNSTAGS;

<!ENTITY % SWAPTAGS             SYSTEM "swap.dtd"                    >
%SWAPTAGS;

<!ENTITY % MYSQLTAGS            SYSTEM "mysql.dtd"                   >
%MYSQLTAGS;

<!ENTITY % TOMCATTAGS            SYSTEM "tomcat.dtd"                 >
%TOMCATTAGS;

<!ENTITY % ORASESSIONSTAGS      SYSTEM "orasessions.dtd"             >
%ORASESSIONSTAGS;

<!ENTITY % NTP		        SYSTEM "ntp.dtd"                     >
%NTPTAGS;

<!ENTITY % NBU		        SYSTEM "nbu.dtd"                     >
%NBUTAGS;

<!ENTITY % NTP-REMOTE	        SYSTEM "ntp-remote.dtd"              >
%NTPTAGS;

<!ENTITY % HYLAFAX	        SYSTEM "hylafax.dtd"                 >
%HYLAFAXTAGS;

<!ENTITY % XEN	        	SYSTEM "xen.dtd"                     >
%XENTAGS;

<!ENTITY % FTP	        	SYSTEM "ftp.dtd"                     >
%FTPTAGS;

<!ENTITY % SMTP	        	SYSTEM "smtp.dtd"                    >
%SMTPTAGS;

<!ENTITY % WEBSPHERE	       	SYSTEM "websphere.dtd"               >
%WEBSPHERETAGS;

<!ENTITY % REAFILE	       	SYSTEM "readfile.dtd"                >
%READFILETAGS;

<!-- ============================================================= -->
<!--          OSAGENTCONFIG                                        -->
<!--          OpenSMART internals                                  -->
<!ELEMENT  OSAGENTCONFIG (COLLECTORSERVER?, CONFIGSERVER?, 
                          DEPLOYMENTSERVER?)                         > 

<!--          COLLECTORSERVER                                      -->
<!--          Where is the OpenSMART server, have we to
              use a proxy server ?                                 -->
<!ELEMENT  COLLECTORSERVER
                        (HOST, PORT, 
                         ( HTTPPROXYIP , HTTPPROXYPORT)?,
			 URL, PROXYURL
                        )                                            >
<!--          CONFIGSERVER                                         -->
<!--          Where is the OpenSMART server, have we to
              use a proxy server ?                                 -->
<!ELEMENT  CONFIGSERVER
                        (HOST, PORT,
                         ( HTTPPROXYIP , HTTPPROXYPORT, URI)?,
                         URL, PROXYURL
                        )                                            >
<!--          DEPLOYMENTSERVER                                     -->
<!--          Where is the OpenSMART deployment server, have we to
              use a proxy server ?                                 -->
<!ELEMENT  DEPLOYMENTSERVER
                        (HOST, PORT,
                         ( HTTPPROXYIP , HTTPPROXYPORT)?,
                         URL, PROXYURL
                        )					     >

<!--          HOST                                                 -->
<!--          Name/IP-Adress of OpenSMART Web Server               -->
<!ELEMENT  HOST         (#PCDATA)                                    >

<!--          PORT                                                 -->
<!--          Port of OpenSMART Web Server                         -->
<!ELEMENT  PORT         (#PCDATA)                                    >

<!--          HTTPPROXYIP                                          -->
<!--          Name/IP-Adress of Proxy, if any to use               -->
<!ELEMENT  HTTPPROXYIP  (#PCDATA)                                    >

<!--          HTTPPROXYPORT                                        -->
<!--          Port of Proxy, if any to use                         -->
<!ELEMENT  HTTPPROXYPORT (#PCDATA)                                   >

<!--          URI                                                  -->
<!--          where lives the config server                        -->
<!ELEMENT  URI (#PCDATA)                                             >

<!--          URL                                                  -->
<!--          where lives the server                               -->
<!ELEMENT  URL (#PCDATA)                                             >

<!--          PROXYURL                                             -->
<!--          where lives the proxy server                         -->
<!ELEMENT  PROXYURL (#PCDATA)                                        >

<!-- ============================================================= -->