Curiosity killed the cat (and sometimes collections...)
The idea was just to beautiful NOT to try it...
1.) let's see what's in the original collection...
[root@NMSSR2:/home/root]> nvUtil l NOK
NT578
ns123121
Fil0143:10.231.21
NT568
Fil0072:10.231.9
2.) get description and rule of collection...
[root@NMSSR2:/home/root]> nvUtil g NOK
Collection: NOK
Description: Critical || Marginal
Rule: (
(
('IP Status' = 'Critical') ||
('IP Status' = 'Marginal')
)
&&
(!('isCard' = True)) &&
(!('isSegment' = True)) &&
(!('CorrStat4' = 'BAUSTELLE'))
)
3.) pipe description and rule to a dummy-file...
[root@NMSSR2:/home/root]> nvUtil g NOK >qwe
4.) modify dummy-file, just keep/modify collection-rule...
[root@NMSSR2:/home/root]> vi qwe
5.) modified dummy-file looks like this...
[root@NMSSR2:/home/root]> cat qwe
(
(
('IP Status' = 'Critical') ||
('IP Status' = 'Marginal') ||
('IP Status' = 'Normal')
)
&&
(!('isCard' = True)) &&
(!('isSegment' = True)) &&
(!('CorrStat4' = 'BAUSTELLE')) &&
('Selection Name' ~ '^NMS')
)
6.) erase original collection...
[root@NMSSR2:/home/root]> nvUtil r NOK
7.) check if empty...
[root@NMSSR2:/home/root]> nvUtil l NOK
8.) get current description and rule...
[root@NMSSR2:/home/root]> nvUtil g NOK
Collection: NOK
Description: Critical || Marginal
Rule:
9.) feed nvUtil with modified rule from dummy-file...
[root@NMSSR2:/home/root]> nvUtil r NOK "`cat qwe`"
10.) check description and rule...
[root@NMSSR2:/home/root]> nvUtil g NOK
Collection: NOK
Description: Critical || Marginal
Rule: (
(
('IP Status' = 'Critical') ||
('IP Status' = 'Marginal') ||
('IP Status' = 'Normal')
)
&&
(!('isCard' = True)) &&
(!('isSegment' = True)) &&
(!('CorrStat4' = 'BAUSTELLE')) &&
('Selection Name' ~ '^NMS')
)
11.) check new contents of modified collection...BINGO!
[root@NMSSR2:/home/root]> nvUtil l NOK
NMSSR1
NMSSR2
NMSXS1
NMSXS2
[root@NMSSR2:/home/root]>
I JUST LOVE THE COMMAND-LINE!
Regards, Ralph.
iT-AUSTRIA / OE2100 / WPNM
Tel (mobil) 0664 1908469
Tel (iT-A) 21717 58948
FAX (iT-A) 21717 58979
Mailto:Ralph.Schiffinger@erstebank.at
P.S. Welcome back, James!
> -----Ursprüngliche Nachricht-----
> Von: Jeff Fitzwater [SMTP:jfitz@PRINCETON.EDU]
> Gesendet am: Mittwoch, 10. November 1999 16:33
> An: NV-L@UCSBVM.ucsb.edu
> Betreff: nvUtil How can I add to existing collection?
>
> Netview 5.1.2 on Solaris 2.6
>
> I want to add a rule to existing collection (Selection Name) via command
> line.
> The collection rule is (('Selection Name' ~ 'node1') || ('Selection
> Name' ~ 'node2'))
>
> It must be done by command line.
>
> Can I use...
>
> nvUtil r 'jftest" "('Selection Name' ~ 'node3')"
>
>
> The above just replaced the rule not add to it.
> Is ther a way to add to the existing rule?
>
> I have tried many combinations but none work.
>
> Thanks for any help.
>
> Jeff Fitzwater
> CIT Systems & Networking
> Princeton University
|