/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk
286 by Suren A. Chilingaryan
Update of setups
1
#! /bin/bash
2
3
4
srv="http://katrin.kit.edu/adei/"
5
setup="katrin"
6
7
function check {
8
    props=$1
9
    src=$2
10
    
11
    req="$srv/services/list.php?setup=$setup&target=groups&$props"
12
    res=`curl $req 2>/dev/null | xmllint --format - | grep "<Value" | sed -e "s/.*value=\"\([^\"]\+\)\".*name=\"\([^\"]\+\)\".*/\\1,\\2/"`
13
    for gr in $res; do
14
        grid=`echo $gr | cut -d ',' -f 1`
15
        grname=`echo $gr | cut -d ',' -f 2`
16
        
17
        req="$srv/services/list.php?setup=$setup&target=items&$props&db_group=$grid"
18
        lines=`curl $req 2>/dev/null | xmllint --format - | wc -l`
19
        req="$srv/services/getdata.php?setup=$setup&$props&db_group=$grid&window=-1&experiment=-&db_mask=0" 
20
        updated=`curl $req 2>/dev/null | tail -n 1 | cut -d ',' -f 1`
21
        echo "$src  $grname    Channels: $lines, Updated: $updated"
22
    done
23
}
24
25
check "db_server=fpd&db_name=katrin_rep" "FPD"
26
check "db_server=msz&db_name=Monitorspeczeus_rep" "MOS"
27
check "db_server=msz&db_name=aircoils_rep" "AC "