#210750 - 2015-09-17 03:12 PM
Re: Creating variable name from a variable
[Re: Allen]
|
Kevin_J_Murphy
Just in Town
Registered: 2015-09-16
Posts: 4
Loc: NH
|
1st of all, I'm not a programmer 
FWIW( I like the snip above and don't think that's complicated at all)
I have a simple script that reads a text file with server names in it. The script pings each server and displays each server name with UP or DOWN for each as appropriate. It pauses 30 seconds and cycles the list again.
I use it to monitor them while being rebooted during patching. Keeping visual track of each of them showing UP, then DOWN, the UP again is easy enough with a small list, and harder with larger ones.
I want to introduce a "Phase" to it where the initial UP is considered Phase1, the DOWN is Phase2 (during rebooting), then the final UP would be Phase3.
So, to me that means creating a variable for each server with this Phase setting that would be incremented as the server when UP then DOWN then back UP again. Since the list is always different then I was hoping to create a couple variables such as:
$Phase To track the server's phase (i.e. 1 2 or 3) $Status To capture the current UP or DOWN for incrementing Phase#
= the server name in the list currently being processed.
Right now I get output like this: UP (or down)
I'd like to have add the phase so that I can tell if it ever went down or not (and back up again): UP Phase_1 (or _2 or _3 as detected)
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 758 anonymous users online.
|
|
|