Skip to content
Snippets Groups Projects
Select Git revision
  • dda4eb278f4f3a0ffa80541d5dde7440d560d6dd
  • master default protected
  • rednatco-v2
  • rednatco
  • test
  • ntc-tube-uniform-color
  • ntc-tube-missing-atoms
  • restore-vertex-array-per-program
  • watlas2
  • dnatco_new
  • cleanup-old-nodejs
  • webmmb
  • fix_auth_seq_id
  • update_deps
  • ext_dev
  • ntc_balls
  • nci-2
  • plugin
  • bugfix-0.4.5
  • nci
  • servers
  • v0.5.0-dev.1
  • v0.4.5
  • v0.4.4
  • v0.4.3
  • v0.4.2
  • v0.4.1
  • v0.4.0
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • v0.3.3
  • v0.3.2
  • v0.3.1
  • v0.3.0
41 results

1grm_updated.cif

Blame
  • example-info.pl.txt 2.53 KiB
    #!/usr/bin/perl -w
    #
    # Copyright (C) 2011-2013 Cesnet z.s.p.o
    #
    # Use of this source is governed by a BSD-style license, see LICENSE file.  
    
    use strict;
    
    #------------------------------------------------------------------------------
    # Warden 2.2 Client, Info, Example
    #
    # Simple use of warden-client Info functionality to receive information about
    # client registered to Warden server. This code illustrates how to integrate
    # warden-client info functionality into local applications.
    #------------------------------------------------------------------------------
    
    #------------------------------------------------------------------------------
    # This code should developer add into his/her application.
    
    # Path to warden-client directory
    my $warden_path = '/opt/warden-client/';
    
    # Inclusion of warden-client receiving functionality
    require $warden_path . '/lib/WardenClientCommon.pm';
    
    my @clients = WardenClientCommon::getClientsInfo($warden_path) or exit 1; # receive data or exit
    
    print "+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n";
    print "| Client ID  | Hostname                       | Registered          | Requestor               | Service                   | CT | Type            | ROE  | Description tags                                   | IP Net Client      |\n";
    print "+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n";
    
    foreach (@clients) {
      printf("| %-10s ", $_->{'client_id'} || "NULL");
      printf("| %-30s ", $_->{'hostname'} || "NULL");
      printf("| %19s ", $_->{'registered'}  || "NULL");
      printf("| %-23s ", $_->{'requestor'} || "NULL");
      printf("| %-25s ", $_->{'service'} || "NULL");
      printf("| %-2s ", $_->{'client_type'}  || "NULL");
      printf("| %-15s ", $_->{'type'} || "NULL");
      printf("| %-4s ", $_->{'receive_own_events'}  || "NULL");
      printf("| %-50s ", $_->{'description_tags'} || "NULL");
      printf("| %-18s |\n", $_->{'ip_net_client'} || "NULL");
    }
    print "+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n";
    print "\n";
    print "Current registered clients in: " . scalar localtime(time) . "\n";
    
    exit 0;