Simple DNS Plus v. 4.00
How to use "warning.bat"

Simple DNS Plus can execute the DOS batch file "warning.bat" from the directory where Simple DNS Plus is installed each time it detects an error/warning condition.
To enable this, set the "WarningBat" option in the "sdnsplus.ini" file to "=Yes".

When run, "warning.bat" is passed a set of 2 parameters (an event ID and a description) from the following list:

Event ID
Description
101
Error: Could not start DNS service [on <ip-address>] (Error <n>)
102
Error: Could not start DHCP service on <ip-address> (Error <n>)
103
Error: could not start HTTP service on port <port-number> (Error <n>)
201
Error: Could not open zone file: <file-name>
202
Error: Could not update 'boot' file for zone: <zone-name>
203
Error: Could not save zone file: <file-name> (Error <n> <error-description>)
301
Warning: UDP packet from <ip-address> port zero ignored
302
Warning: IP address <ip-address> blocked (more than <n> requests per second)
303
Warning: Request from <ip-address> for BIND version - possible hack attempt
304
Warning: TCP connection from <ip-address> closed - Telnet detected
305
Warning: TCP connection request rejected - maximum connections (<n>) reached
401
Warning: Lame delegation for <zone-name> on this server (<ip-address>)
501
Warning: Notify request not sent to <server-name> for <zone-name> - Could not resolve IP address
502
Warning: [<server-name>] [<ip-address>] did not respond to Notify request for <zone-name>
503
Warning: Failed to Zone Transfer <zone-name> from <ip-address> (<error-description>)
601
Warning: Forward server <ip-address> does not offer recursion
701
Warning: Error opening log file [<error-description>]
702
Warning: Error writing to log file [<error-description>]
703
Warning: Error opening raw log file [<error-description>]
704
Warning: Error writing to raw log file [<error-description>]
999
Error: Application error: [<error-description>]


These parameters can be accessed in the batch file as %1 (the event ID) and %2 (the description).
For example to send a network alert to the administrator, the "warning.bat" file could look like this:
NET SEND administrator "SDNSPLUS: %2"


If you only wanted to know about "Lame delegation on this server" warnings:
IF NOT %1==401 EXIT
NET SEND administrator "SDNSPLUS: %2"

Or you could pass one or both parameters to a VBScript or JavaScript:
WSCRIPT warning.vbs %1 ""%2""

As an example, a VBScript file used to send an e-mail might look like this (assuming Simple DNS Plus runs on a computer with IIS including SMTP installed):
EventID=WScript.Arguments(0)
EventDesc=WScript.Arguments(1)
Set MailObj=CreateObject("CDONTS.NewMail")
MailObj.From="""Simple DNS Plus"" <sdnsplus@mydomain.com>"
MailObj.To="<hostmaster@mydomain.com>"
MailObj.Subject="Message from Simple DNS Plus"
MailObj.Body="Event ID: " & EventID & vbcrlf & _
              "Description: " & EventDesc & vbcrlf
MailObj.Send

To learn more about the individual errors/warnings, please see How to read the log.



© 1999-2005 JH Software - All rights reserved