File: nagzillac.pl

package info (click to toggle)
nagzilla 2.0-1.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, sid
  • size: 504 kB
  • sloc: perl: 272; sh: 191; makefile: 17
file content (42 lines) | stat: -rwxr-xr-x 946 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/perl

#(c)2007-2009 Hurricane Labs
#Author: Billford
#License: See LICENSE file GPL v2
#Nagzilla Jabber Relay Client

require Config::Simple;
require Data::Dumper;
use IO::Socket;
use IO::Socket::INET;

#bring in our configuration variables
$CONFDIR = "/etc/nagzillac";

# DO NOT EDIT ANYTHING BEYOND THIS POINT!!

##################Begin Config Setup########################

Config::Simple->import_from('nagzillac.cfg', \%Config);
$cfg = new Config::Simple("$CONFDIR/nagzillac.cfg");

#Nagzillac Nagzilla Server Settings

$nagzillaserver = $cfg->param("NagzillaServer");
$nagzillaport  = $cfg->param("NagzillaPort");

##################End Config Setup##########################

#Let's make us a socket connection
$remote = IO::Socket::INET->new(
   Proto    => 'tcp',
   PeerAddr => "$nagzillaserver",
   PeerPort => "$nagzillaport",
   Reuse    => 1
) or die "$!";

$remote->autoflush(1);

print $remote $ARGV[0];

close $remote;