UNSOLVED

changalrai

updated

17 years ago

C

changalrai

1 Rookie

•

100 Posts

0

1147

August 12th, 2009 21:00

how to find out how many clients are there in a group

how to find out how many clients are there in a group

i want in command line please
  • DavidHampson

    2 Intern

    •

    1080 Posts

    698

    0

    Posted August 13th, 2009 00:00

    if you just want the names of clients then your nsradmin query would be something like:

    show name
    . type:NSR client;group:groupname

    you can put that into a file and run it using nsradmin -i filename if you want to run it from a scripts

    Your output will be in the form of:

    name: host1

    name: host2

    etc

    Get rid of the spaces by grepping out empty lines:

    grep -v "^$"

    And then pipe the output to wc to get the count

    wc -l

    So once you have your query file for nsradmin:

    nsradmin -i filename|grep -v "^$"|wc -l

    If you didn't want to do a count but wanted to use the client names for input to something else use the sed command to strip away the "name:" and ";"

    nsradmin -i filename|grep -v "^$"|sed "s/name: //g"|sed "s/;//g"
  • ark-flUcr

    23 Posts

    698

    0

    Posted August 13th, 2009 00:00

    hello;

    you could use nsradmin for querys.

    for example, you can use -i option to pass the query.

    #more script_clients
    show name; scheduled backup;group;comment
    print NSR client
    #
    #nsradmin -i script_clients
    name: n1backupserver3.lgp.ehu.es;
    scheduled backup: Disabled;
    comment: PRUEBAS 2;
    group: ;

    name: lgax08.lgp.ehu.es;
    scheduled backup: Enabled;
    comment: PRODUCCIÓN BACKUP A NIVEL DE FICHEROS (NO RMAN);
    group: LGUX32_ANUAL_RH_2, LGUX32_DIARIO_RA_2,
    LGUX32_MENSUAL_RA_2;
    ...
    ...
    #

    you could use that information to do a personal script and optain your query. Obtain the clients and their groups, with other query the groups.....



    if you want to know how you could see with nsradmin,do:

    1.- nsradmin
    #nsradmin
    2.- use v to visual
    nsradmin> v

    Command: Select [Next] Prev Edit Create Delete Options Quit
    1 of 594 (on lXXXXXXXXX)

    type: NSR license;
    name: "Autochanger Module, 40 slots/40";
    comment: ;
    enabler code: d65d58-b12222-3ac09c;
    host id: 007f0100;
    expiration date: Authorized - No expiration date;
    auth code: 0e28ba0d;
    3.- using select you see cliet, group... and with next or prev you see the propieties of objects.


    Arkaitz