Index: trunk/tools/nparser/fetch.sh |
— | — | @@ -11,9 +11,8 @@ |
12 | 12 | exit 1 |
13 | 13 | fi |
14 | 14 | mkdir "$temp" |
15 | | - wget https://labsconsole.wikimedia.org/wiki/Special:Ask/-5B-5BResource-20Type::instance-5D-5D/-3FInstance-20Name/-3FInstance-20Type/-3FProject/-3FImage-20Id/-3FFQDN/-3FLaunch-20Time/-3FPuppet-20Class/-3FModification-20date/-3FInstance-20Host/-3FNumber-20of-20CPUs/-3FRAM-20Size/-3FAmount-20of-20Storage/limit%3D500/format%3Djson -O $temp/novalist |
16 | | - if [ "`diff old/* $temp/*`" = "" ];then |
17 | | - echo OK |
| 15 | + wget https://labsconsole.wikimedia.org/wiki/Special:Ask/-5B-5BResource-20Type::instance-5D-5D/-3FInstance-20Name/-3FInstance-20Type/-3FProject/-3FImage-20Id/-3FFQDN/-3FLaunch-20Time/-3FPuppet-20Class/-3FModification-20date/-3FInstance-20Host/-3FNumber-20of-20CPUs/-3FRAM-20Size/-3FAmount-20of-20Storage/limit%3D500/format%3Djson -O $temp/novalist -o logs |
| 16 | + if [ "`diff old/* $temp/*`" != "" ];then |
18 | 17 | out=`./parser "$temp"` |
19 | 18 | if [ `echo $out | grep -c Error` -gt 0 ];then |
20 | 19 | echo Unable to parse the file |
— | — | @@ -24,7 +23,9 @@ |
25 | 24 | list2=`echo "$out" | awk '{ if (p==1) print $0; p=2 } { if ($0 ~ /SSH:/) p=1 }'` |
26 | 25 | for instance in `echo "$instances"` |
27 | 26 | do |
| 27 | + if [ "$instance" != "nagios" ];then |
28 | 28 | cat default.cfg | sed "s/NAME/$instance/" > conf/$instance".cfg" |
| 29 | + fi |
29 | 30 | done |
30 | 31 | cp generic/* conf |
31 | 32 | cat hostgroup | sed "s/#web/$list1/" | sed "s/#SSH/$list2/" > conf/hostgroups_nagios2.cfg |