[irc2] Add port and SSL/TLS support, add IPv6 env variable (#1308)
This commit is contained in:
parent
9c17efc39b
commit
84def98b95
|
@ -7,13 +7,18 @@ ircstats - Plugin to graph data about an IRC network and a single IRC server
|
||||||
|
|
||||||
=head1 CONFIGURATION
|
=head1 CONFIGURATION
|
||||||
|
|
||||||
- ENV{SERVER} to point to the server to connect to, defaults to localhost.
|
- env.SERVER to point to the server to connect to, defaults to localhost.
|
||||||
- ENV{NICK} nickname to use, defaults to munin-$HASH.
|
- env.PORT port to use, defaults to 6667.
|
||||||
|
- env.NICK nickname to use, defaults to munin-$HASH.
|
||||||
|
- env.USESSL 0 or 1 values to enable SSL/TLS, defaults to 0.
|
||||||
|
- env.USEIPV6 0 or 1 to enable IPv6 use, defaults to 0.
|
||||||
|
|
||||||
=head1 USAGE
|
=head1 USAGE
|
||||||
|
|
||||||
This plugin connects to an IRC server.
|
This plugin connects to an IRC server.
|
||||||
|
|
||||||
|
It requires POE::Component::IRC and POE::Component::SSLify if you use SSL/TLS.
|
||||||
|
|
||||||
=head1 AUTHOR
|
=head1 AUTHOR
|
||||||
|
|
||||||
Robin H. Johnson
|
Robin H. Johnson
|
||||||
|
@ -35,9 +40,11 @@ use Digest::MD5 qw(md5_hex);
|
||||||
my $nickname = $ENV{NICK} || 'munin-'.md5_hex(rand().time());
|
my $nickname = $ENV{NICK} || 'munin-'.md5_hex(rand().time());
|
||||||
my $ircname = "Munin statistics gathering from $ENV{FQDN}";
|
my $ircname = "Munin statistics gathering from $ENV{FQDN}";
|
||||||
my $server = $ENV{SERVER} || 'localhost';
|
my $server = $ENV{SERVER} || 'localhost';
|
||||||
|
my $port = $ENV{PORT} || 6667;
|
||||||
|
my $usessl = $ENV{USESSL} || 0;
|
||||||
|
my $useipv6 = $ENV{USEIPV6} || 0;
|
||||||
|
|
||||||
if($ARGV[0] and $ARGV[0] eq "config") {
|
if($ARGV[0] and $ARGV[0] eq "config") {
|
||||||
print "host_name $server\n";
|
|
||||||
print "graph_title ircd status - $server\n";
|
print "graph_title ircd status - $server\n";
|
||||||
print "graph_category chat\n";
|
print "graph_category chat\n";
|
||||||
print "graph_order clients channels servers localclients clientmax localclientmax localservers opers unknownconns\n";
|
print "graph_order clients channels servers localclients clientmax localclientmax localservers opers unknownconns\n";
|
||||||
|
@ -70,8 +77,10 @@ my $irc = POE::Component::IRC->spawn(
|
||||||
nick => $nickname,
|
nick => $nickname,
|
||||||
ircname => $ircname,
|
ircname => $ircname,
|
||||||
server => $server,
|
server => $server,
|
||||||
|
port => $port,
|
||||||
raw => 0,
|
raw => 0,
|
||||||
useipv6 => 0,
|
UseSSL => $usessl,
|
||||||
|
useipv6 => $useipv6,
|
||||||
) or die "Oh noooo! $!";
|
) or die "Oh noooo! $!";
|
||||||
|
|
||||||
POE::Session->create(
|
POE::Session->create(
|
||||||
|
|
Loading…
Reference in New Issue