Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit of the isdn_channels.pl file

  • Loading branch information...
commit 4fe6cfa2080e71ce1d85c921a9c424403c0d08f5 1 parent 4cbcaf6
Daniel Nilsen authored
Showing with 32 additions and 0 deletions.
  1. +32 −0 cacti-scripts/isdn_channels.pl
32 cacti-scripts/isdn_channels.pl
View
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+#
+# returns active isdn channels on TANDBERG ISDN GATEWAY
+#
+#
+require RPC::XML::Client;
+
+
+#
+# Brukernavn og passord og ip-adr hentes fra kommandolinja
+#
+my $user=shift;
+my $password=shift;
+my $addr=shift;
+
+
+$cli = RPC::XML::Client->new('http://'.$addr.'/RPC2');
+
+$options = RPC::XML::struct->new(
+'authenticationUser' => $user,
+'authenticationPassword' => $password,
+'port' => 0); # sender brukernavn,passord og isdn portnummer som option
+
+$resp = $cli->simple_request('isdn.port.query',$options); # xml-request
+
+#
+
+for ($i=0;$i<=30;$i++){
+$test=$test + $resp->{'bChannels'}->[$i]->{'active'}; # går igjennom alle kanalene og plusser sammen linjene som er i bruk.
+}
+
+print "active:".$test;
Please sign in to comment.
Something went wrong with that request. Please try again.