App-MonM

 view release on metacpan or  search on metacpan

bin/monm_dbi  view on Meta::CPAN

Version 1.01

=head1 SYNOPSIS

    monm_dbi [ --dsn=DSN | --sid=SID ] [ --user=DB_USERNAME ]
             [ --password=DB_PASSWORD ] [ --sql=SQL ]
             [-a "DBI_ATTR_1=Value"] [-a "DBI_ATTR_n=Value"]

    monm_dbi -n "DBI:mysql:database=test;host=192.0.0.1"
             -u user -p password -q "SELECT * FROM mytable"
             -a "mysql_enable_utf8=1" -a "PrintError=0"

=head1 OPTIONS

=over 4

=item B<-a "DBI_Attribute=Value">

    -a "DBI_Attribute=Value"
    -a "DBI_Attribute Value"

eg/checkit-dbi.conf  view on Meta::CPAN

    Enable      on

    Type        dbi
    DSN         DBI:mysql:database=test;host=192.168.0.1
    SQL         "SELECT 'OK' AS OK FROM DUAL" # By default
    User        user
    Password    password
    Timeout     15 # Connect and request timeout, secs
    Set RaiseError 0
    Set PrintError 0
    Set mysql_enable_utf8 1

    Target      content
    IsTrue      OK
</Checkit>

lib/App/MonM/Checkit/DBI.pm  view on Meta::CPAN


        Enable  yes
        Type    dbi
        DSN     DBI:mysql:database=DBNAME;host=127.0.0.1
        SQL     "SELECT 'OK' AS OK FROM DUAL"
        User    USER
        Password PASSWORD
        Timeout 15s
        Set RaiseError  0
        Set PrintError     0
        Set mysql_enable_utf8   0

        # . . .

    </Checkit>

=head1 DESCRIPTION

Checkit DBI subclass

=head2 check

lib/App/MonM/Checkit/DBI.pm  view on Meta::CPAN


    Set RaiseError     0
    Set PrintError     0

Defines DBI Attributes. This directive allows you set case sensitive DBI Attributes.
There can be several such directives.

Examples:

    Set sqlite_unicode      1
    Set mysql_enable_utf8   0

Default: no specified

=item B<Timeout>

    Timeout    1m

Defines the timeout of DBI requests

Default: off

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

#    Set sqlite_unicode 1
# </Store>
#
# MySQL example:
# <Store>
#    DSN "DBI:mysql:database=monm;host=mysql.example.com"
#    User username
#    Password password
#    Set RaiseError          0
#    Set PrintError          0
#    Set mysql_enable_utf8   1
#    Set mysql_auto_reconnect 1
# </Store>
#

#
# REQUIRED channel (SendMail) that defines default options for sending
# email-notifications and email-reports
#
<Channel SendMail>
    Type    Email

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


    use App::MonM::Store;

    my $store = App::MonM::Store->new(
        dsn => "DBI:mysql:database=monm;host=mysql.example.com",
        user => "username",
        password => "password",
        set => [
            "RaiseError        0",
            "PrintError        0",
            "mysql_enable_utf8 1",
        ],
    );
    die($store->error) if $store->error;

=head1 DESCRIPTION

DBI interface for checkit's data storing. This module provides store methods

=head2 new

    my $store = App::MonM::Store->new(
        dsn => "DBI:mysql:database=monm;host=mysql.example.com",
        user => "username",
        password => "password",
        set => [
            "RaiseError        0",
            "PrintError        0",
            "mysql_enable_utf8 1",
        ],
    );

Creates DBI object

=head2 add

    $store->add(
        name    => "foo",
        type    => "http",



( run in 0.373 second using v1.01-cache-2.11-cpan-00829025b61 )