diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-02 13:16:24 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-02 13:16:24 +0200 |
commit | b15adb7762b6caaecaa83637abfcf5fdb4802092 (patch) | |
tree | 64eddbe2aa1a7f98a140be0f7973f05d7a781ae0 /contrib/nagios_sendim.pl | |
parent | c4d5882b9e1d07c7b61091062b7d085fa5f00284 (diff) | |
download | monitoring-plugins-b15adb7762b6caaecaa83637abfcf5fdb4802092.tar.gz |
Remove "contrib" plugins
These days, sites such as "Nagios Exchange" are a much better place for
publishing plugins not maintained by the Plugins Development Team.
Diffstat (limited to 'contrib/nagios_sendim.pl')
-rw-r--r-- | contrib/nagios_sendim.pl | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/contrib/nagios_sendim.pl b/contrib/nagios_sendim.pl deleted file mode 100644 index 02870a6d..00000000 --- a/contrib/nagios_sendim.pl +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | #!/usr/bin/perl -w | ||
2 | # | ||
3 | # SENDIM 1.0 by Sergio Freire (sergio-s-freire@ptinovacao.pt) | ||
4 | # Nagios plugin to send notifications using instant messages through a jabber server | ||
5 | # | ||
6 | # Note: a) you can send messages to several different IM systems like ICQ,AIM,MSN,etc... | ||
7 | # b) to test this plugin you can execute it with the arguments needed and write the message followed by a CTRL+D | ||
8 | # | ||
9 | # Please check http://www.jabber.org and http://www.jabberstudio.org for more information on Jabber Instant Messaging | ||
10 | |||
11 | |||
12 | use Net::Jabber qw(Client); | ||
13 | use Getopt::Std; | ||
14 | |||
15 | my $tmp; | ||
16 | my $mensagem=""; | ||
17 | getopts("u:p:t:"); | ||
18 | if ( (!defined($opt_u)) || (!defined($opt_p)) || (!defined($opt_t))) | ||
19 | { | ||
20 | print "USE: sendim -u user_JID -p password -t destination_JID\n"; | ||
21 | print 'EXAMPLE: sendim -u nagios@jabber.org -p nagios -t bitcoder@nagios.org'."\n"; | ||
22 | print " (send an instant message as user nagios\@jabber.org to bitcoder\@jabber.org)\n"; | ||
23 | exit; | ||
24 | } | ||
25 | |||
26 | my @buf=split('@',$opt_u); | ||
27 | my $login=$buf[0]; | ||
28 | @buf=split('/',$buf[1]); | ||
29 | my $server=$buf[0]; | ||
30 | my $resource=$buf[1] || "nagios"; | ||
31 | my $password=$opt_p; | ||
32 | my $jid_dest=$opt_t; | ||
33 | my $debug=0; # Set debug=1 to enable output of debug information | ||
34 | |||
35 | while ($tmp=<STDIN>) | ||
36 | { | ||
37 | $mensagem.=$tmp; | ||
38 | } | ||
39 | |||
40 | print "LOGIN: $login\nSERVER: $server\nRESOURCE: $resource\n" if $debug; | ||
41 | print "TO: $jid_dest\n" if $debug; | ||
42 | |||
43 | $Con1 = new Net::Jabber::Client(); | ||
44 | $Con1->Connect(hostname=>$server); | ||
45 | |||
46 | if ($Con1->Connected()) { | ||
47 | print "CON1: We are connected to the server...\n" if $debug; | ||
48 | } | ||
49 | |||
50 | @result1 = $Con1->AuthSend(username=>$login, | ||
51 | password=>$password, | ||
52 | resource=>$resource); | ||
53 | |||
54 | |||
55 | $Con1->PresenceSend(); | ||
56 | $Con1->Process(1); | ||
57 | |||
58 | @result1=$Con1->MessageSend( to=>$jid_dest, | ||
59 | subject=>"nagios", | ||
60 | body=>$mensagem, | ||
61 | type=>"chat", | ||
62 | priority=>1); | ||
63 | |||
64 | $Con1->Process(1); | ||
65 | $Con1->Disconnect(); | ||
66 | exit; | ||