App-MonM

 view release on metacpan or  search on metacpan

lib/App/MonM/ConfigSkel.pm  view on Meta::CPAN

#
<Channel SendMail>
    Type    Email
    Enable  on

    # Real Email addresses
    To      to@example.com
    #Cc     cc@example.com
    #Bcc    bcc@example.com
    From    from@example.com

    # MIME options
    Encoding base64

    # SMTP extra headers
    #<Headers>
    #    X-Foo foo
    #    X-Bar bar
    #</Headers>

    # Attachments
    #<Attachment>
    #    Filename    screenshot.png
    #    Type        image/png
    #    Encoding    base64
    #    Disposition attachment
    #    Path        ./screenshot.png
    #</Attachment>
    #<Attachment>
    #    Filename    payment.pdf
    #    Type        application/pdf
    #    Encoding    base64
    #    Disposition attachment
    #    Path        ./payment.pdf
    #</Attachment>

    # SMTP options
    # If there are requirements to the case sensitive of parameter
    # names, use the "Set" directives
    Set host 192.168.0.1
    Set port 25
    #Set sasl_username TestUser
    #Set sasl_password MyPassword
    Set timeout 20
</Channel>

#
# OPTIONAL channel (SMSGW) that defines default options for sending
# SMS-notifications
#
<Channel SMSGW>
    Type    Command
    Enable  on

    #At Sun-Sat[08:00-19:00]

    # Default phone number (MSISDN)
    To +1-424-254-5300

    # SMS Gateway timeout (to SMDP server, eg.)
    Timeout 10s

    # Command for sending
    #Command "echo "[MSISDN]; [SUBJECT]; [MESSAGE]" >> /tmp/fakesms.txt"
    #Command "sendalertsms "[MSISDN]" "[SUBJECT]" "[MESSAGE]""
    #Command "monm_dbi -s SIDNAME -u USER -p PASSWORD -q "SELECT SMS_FUNCTION('[MSISDN]', '[MESSAGE]') FROM DUAL" [MSISDN]"
    #Command "smsbox -D /tmp/smsbox create [MSISDN] "[MESSAGE]""
    #Command curl -d "[MESSAGE]" "https://sms.com/?[MSISDN]"
    Command "echo "[MSISDN];[MESSAGE]" >> /tmp/fakesms.txt"

    #
    # Replacement variables:
    #
    #   [ID]      -- Internal ID of the message
    #   [MSISDN]  -- Phone number
    #   [SUBJECT] -- Subject of message
    #   [MESSAGE] -- SMS body (reality this is also a subject)
    #

</Channel>

#
# Named users
#
#
#<User Bob>
#    Enable on
#
#    At Sun[off];Mon-Thu[08:30-12:30,13:30-18:00];Fri[10:00-20:30];Sat[off]
#
#    <Channel SendMail>
#        To bob@example.com
#    </Channel>
#
#    <Channel MySMS>
#        BasedOn SMSGW
#        To +1-424-254-5301
#        At Mon-Fri[08:30-18:30]
#    </Channel>
#</User>
#
#<User Alice>
#    Enable on
#
#    At Mon-Fri[08:30-18:30]
#
#    <Channel SendMail>
#        To alice@example.com
#    </Channel>
#
#    <Channel AliceGW>
#        Type    Command
#        To  +1-424-254-5301
#        Content email
#        Command "tee /tmp/alice.msg > /dev/null"
#    </Channel>
#</User>
#
#<User Ted>
#    Enable on
#

lib/App/MonM/ConfigSkel.pm  view on Meta::CPAN

    #   [MESSAGE], [MSG] -- The checker message content
    #   [MSISDN]    -- Phone number, recipient
    #   [NAME]      -- Checkit section name
    #   [NOTE]      -- The checker notes
    #   [RESULT]    -- The check result: PASSED/FAILED
    #   [SOURCE], [SRC]  -- Source string (URL, Command, etc.)
    #   [STATUS]    -- The checker status: OK/ERROR
    #   [SUBJECT], [SBJ] -- Subject of message (MIME)
    #   [TYPE]      -- Type of checkit: http/dbi/command
    #
    #Trigger  "curl http://mywebcam.com/[NAME]/[ID]?[MSISDN] >/tmp/snapshot.jpg"

    #
    # Defines a List of Recipients for notifications.
    # There can be several such directives
    #
    # Email addresses for sending notifications directly (See Channel SendMail)
    #SendTo  foo@example.com
    #SendTo  bar@example.com
    #
    # ...or SMS phone numbers (See Channel SMSGW):
    #SendTo 11231230002
    #SendTo +11231230001
    #SendTo +1-123-123-0003
    #
    # ...or a notify users:
    #SendTo Bob, Alice
    #SendTo Fred
    SendTo  Alice
    #
    # ...or a notify groups:
    #SendTo @Foo, @Bar
    #SendTo @Baz



    ###################################
    ## For HTTP requests (Type http) ##
    ###################################

    #
    # Defines the URL for HTTP/HTTPS requests
    #
    # Default: http://localhost
    #
    #URL   https://user:password@www.example.com
    URL    https://www.example.com

    #
    # Defines the HTTP method: GET, POST, PUT, HEAD, PATCH, DELETE, and etc.
    #
    # Default: GET
    #
    #Method    GET

    #
    # Defines the timeout of HTTP requests
    #
    # Default: 180
    #
    #Timeout    180

    #
    # Defines HTTP request headers.
    # This directive allows you set case sensitive HTTP headers.
    # There can be several such directives.
    #
    # Set User-Agent  "MyAgent/1.00"
    # Set X-Token     "mdffltrtkmdffltrtk"

    #
    # Specifies POST/PUT/PATCH request content
    #
    # Set Content-Type text/plain
    # Content  "Content for HTTP request"
    #
    # Default: no content

    #
    # Defines the proxy URL for a http/https requests
    #
    # Default: no proxy
    #
    #Proxy http://http.example.com:8001/



    ##################################
    ## For DBI requests (Type dbi)  ##
    ##################################

    #
    # Sets Database DSN string
    #
    # Default: dbi:Sponge:
    #
    #DSN     DBI:mysql:database=DATABASE;host=HOSTNAME

    #
    # Specifies the SQL query string (content)
    #
    # Default: "SELECT 'OK' AS OK FROM DUAL"
    #
    #SQL "SELECT 'OK' AS OK FROM DUAL"

    #
    # Defines database credential: username and password
    #
    #User        USER
    #Password    PASSWORD

    #
    # Defines the timeout of DBI requests
    #
    # Default: off
    #
    #Timeout    20s

    #
    # Defines DBI Attributes.
    # This directive allows you set case sensitive DBI Attributes.
    # There can be several such directives.
    #
    #Set sqlite_unicode 1
    #
    #Set RaiseError     0
    #Set PrintError     0



    #######################################
    ## For system command (Type command) ##
    #######################################

    #
    # Defines full path to external program (command line)
    #
    # Default: none
    #
    Command     perl -w

    #
    # Sets the content for command STDIN
    #
    # Default: no content
    #
    Content     "print q/Blah-Blah-Blah/"

    #
    # Defines the execute timeout
    #
    # Default: off
    #
    #Timeout    1m

</Checkit>

-----END FILE-----

-----BEGIN FILE-----
Name: checkit-foo.conf
File: conf.d/checkit-foo.conf
Mode: 644

#
# See checkit-foo.conf.sample and general documentation for details
#
<Checkit "foo">
    Enable      yes
    URL         https://www.example.com
    Target      code
    IsTrue      200
</Checkit>

-----END FILE-----



( run in 1.454 second using v1.01-cache-2.11-cpan-39bf76dae61 )