Changeset b8e4ac4354d8201d78c1a9166c597998bcb3167c

Show
Ignore:
Timestamp:
09/07/08 05:17:30 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1220764650 +0000
git-parent:

[95f6a3eb99f73571cb5863ecdb354de2d12f85be]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1220764650 +0000
Message:

more docs, fixups.. Better smtp options and docs. refs #21

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/Makefile.in

    rdb656f3 rb8e4ac4  
    101101 
    102102module-online.h:        modules/module-online.xsl 
    103         @echo "- making module-online.h (StyleSheet include
     103        @echo "- making module-online.h (StyleSheet include)
    104104        @$(XML2H) helpStyleXML < modules/module-online.xsl > $@ 
    105105 
  • src/modules-lua/noit/module/smtp.lua

    ra4c778e rb8e4ac4  
    1 -- This connects to a Varnish instance on the management port (8081) 
    2 -- It issues the stats comment and translates the output into metrics 
    3  
    41module(..., package.seeall) 
    52 
    63function onload(image) 
     4  image.xml_description([=[ 
     5<module> 
     6  <name>smtp</name> 
     7  <description><para>Send an email via an SMTP server.</para></description> 
     8  <loader>lua</loader> 
     9  <object>noit.module.smtp</object> 
     10  <moduleconfig /> 
     11  <checkconfig> 
     12    <parameter name="port" required="optional" default="25" 
     13               allowed="\d+">Specifies the TCP port to connect to.</parameter> 
     14    <parameter name="ehlo" required="optional" default="noit.local" 
     15               allowed="\d+">Specifies the EHLO parameter.</parameter> 
     16    <parameter name="from" required="optional" default="" 
     17               allowed="\d+">Specifies the envelope sender.</parameter> 
     18    <parameter name="to" required="required" 
     19               allowed="\d+">Specifies the envelope recipient.</parameter> 
     20    <parameter name="payload" required="optional" default="Subject: Testing" 
     21               allowed="\d+">Specifies the payload sent (on the wire). CR LF DOT CR LF is appended automatically.</parameter> 
     22  </checkconfig> 
     23  <examples> 
     24    <example> 
     25      <title>Send an email to test SMTP service.</title> 
     26      <para>The following example sends an email via 10.80.117.6 from test@omniti.com to devnull@omniti.com</para> 
     27      <programlisting><![CDATA[ 
     28      <noit> 
     29        <modules> 
     30          <loader image="lua" name="lua"> 
     31            <config><directory>/opt/reconnoiter/libexec/modules-lua/?.lua</directory></config> 
     32          </loader> 
     33          <module loader="lua" name="smtp" object="noit.module.smtp"/> 
     34        </modules> 
     35        <checks> 
     36          <check uuid="2d42adbc-7c7a-11dd-a48f-4f59e0b654d3" module="smtp" target="10.80.117.6"> 
     37            <config> 
     38              <from>test@omniti.com</from> 
     39              <to>devnull@omniti.com</to> 
     40            </config> 
     41          </check> 
     42        </checks> 
     43      </noit> 
     44      ]]></programlisting> 
     45    </example> 
     46  </examples> 
     47</module> 
     48]=]); 
    749  return 0 
    850end 
     
    73115  end 
    74116 
     117  local ehlo = string.format("EHLO %s", check.config.ehlo or "noit.local") 
    75118  local mailfrom = string.format("MAIL FROM:<%s>", check.config.from or "") 
    76119  local rcptto = string.format("RCPT TO:<%s>", check.config.to) 
     120  local payload = check.config.payload or "Subject: Test\n\nHello." 
     121  payload = payload:gsub("\n", "\r\n") 
    77122  local action = mkaction(e, check) 
    78123  if     action("banner", nil, 220) 
     124     and action("ehlo", ehlo, 250) 
    79125     and action("mailfrom", mailfrom, 250) 
    80126     and action("rcptto", rcptto, 250) 
    81127     and action("data", "DATA", 354) 
    82      and action("body", "Subject: Test\r\n\r\nHello.\r\n.", 250) 
     128     and action("body", payload .. "\r\n.", 250) 
    83129     and action("quit", "QUIT", 221) 
    84130  then 
  • src/modules-lua/noit/module/varnish.lua

    r1010758 rb8e4ac4  
    1414  <checkconfig> 
    1515    <parameter name="port" required="optional" default="8081" 
    16                allowed="\\d+">Specifies the port on which the management interface can be reached.</parameter> 
     16               allowed="\d+">Specifies the port on which the management interface can be reached.</parameter> 
    1717  </checkconfig> 
    1818  <examples>