[Orca-dev] Re: RE[2]: Digest 336
Blair Zajac
blair at orcaware.com
Wed Oct 10 14:06:08 PDT 2001
Rusty,
Would you mind sending me a new patch for your new states columns so it can
go into the next orcallator.se? A couple of requests.
1) If you could format the lines down to 80 characters, probably by splitting
the line into multiple lines, that would be great.
statetmp = lr_disk$dr.state; states[0] = state_char(statetmp);
sum_states[0] = state_dig(statetmp);
2) Use the latest orcallator.se 1.30b1 at
http://www.orcaware.com/orca/pub/orcallator.se-1.30b1.txt
to apply the patch to.
3) I'm thinking of the best names for the new columns. The 'w' after each
character, what does it mean? I'm thinking of changing it so 's' or 'S'
for state. Probably making the column longer, such as Dstate, Nstate,
etc would be best and not collide with any other names.
Thanks,
Blair
Rusty Carruth wrote:
>
> alegrand at wallace.com wrote:
> > I am unclear about the hardware that Rusty is using his short disk name
> > is dad0.
>
> Well, this is an Ultra 5 running Solaris 2.5.1.
>
> I modified orcallator.se to tell me what the short names were as it added
> them,
> and it got this list:
>
> adding raw disk. short name: dad0
> adding raw disk. short name: atapicd2
> adding raw disk. short name: fd0
>
> (this is on SunOS msfree 5.5.1 Generic_103640-32 sun4u sparc SUNW,Ultra-5_10)
>
> Over in the other building I found one machine that gave me this:
>
> adding raw disk. short name: sd0
> adding raw disk. short name: sd1
> adding raw disk. short name: sd2
>
> (and that was on SunOS cass 5.5.1 Generic_103640-24 sun4u sparc SUNW,Ultra-1)
>
> > Every short disk name that I have seen is "sdXX" this maybe the source of
> > the problem. I am sure that I used this to recognize this disk. So now
> > I find myself it the same situation you keep having.
> >
> > I have an idea what the problem is but I do not have the hardware it is
> > happening on to replicate it.
> >
> > The best solution would be for Rusty and I figure out what needs to be
> > changed.
>
> Well, like I say, I did this (more comments follow the code stuff):
>
> bash-2.04$ diff -u /tmp/orca*
> --- /tmp/orcallator.se Thu Oct 4 12:55:22 2001
> +++ /tmp/orcallator.se.orig Thu Oct 4 12:55:22 2001
> @@ -470,7 +470,10 @@
> // already identified how many physical devices are present and they
> // are listed first we limit our self to mapping the first
> // RAW_disk_count device name.
> +//printf("raw disk count is %d, changed to
> %d\n",RAW_disk_count,RAW_disk_count - 1);
> +printf("raw disk count is %d\n",RAW_disk_count);
> for (i=0; i<RAW_disk_count; i++) {
> +printf("I is now %d\n",i);
> strcpy(long_name,GLOBAL_disk_info[i].long_name);
> if (long_name[0] == 'c' && strchr(long_name, 's') == nil) {
> strcpy(short_name,GLOBAL_disk_info[i].short_name);
> @@ -535,6 +538,8 @@
> strcpy(short_name, nkp[0].ks_name);
> if (short_name[0] != 'm' &&
> short_name[0] != 'n' &&
> + short_name[0] != 'f' && // fd fails on sun - rcarruth
> + short_name[1] != 'd' && // ditto - rcarruth
> strchr(short_name,',') == nil) {
> // Try to locate device.
> for (rdisk=0; rdisk<RAW_disk_count;rdisk++) {
> @@ -550,6 +555,7 @@
> RAW_disk_map = 1;
> strcpy(RAW_disk[rdisk].long_name, short_name);
> strcpy(RAW_disk[rdisk].short_name, short_name);
> +printf("adding raw disk. short name: %s\n",short_name);
> RAW_disk[rdisk]._reads = 0;
> RAW_disk[rdisk]._nread = 0;
> RAW_disk[rdisk]._rlentime = 0;
> @@ -1041,31 +1047,48 @@
> }
> }
>
> +/* state as a digit */
> +int state_dig(int state) {
> + switch(state) {
> + case ST_WHITE: return '0'; /* OK states are zero */
> + case ST_BLUE: return '0';
> + case ST_GREEN: return '0';
> + case ST_AMBER: return '1';/* bad states have a non-zero value.
> + case ST_RED: return '2';
> + case ST_BLACK: return '4';
> + default: return '9'; /* invalid state */
> + }
> +}
> +
> measure_misc(long now, tm_t tm_now)
> {
> long uptime;
> char states[12];
> char tm_buf[16];
> + char sum_states[24];
> + int statetmp;
>
> uptime = now - boot_time;
> + sum_states = "0 0 0 0 0 0 0 0 0 0 0";
> states = "wwwwwwwwwww";
> strftime(tm_buf, sizeof(tm_buf), "%T", tm_now);
> -
> - states[0] = state_char(lr_disk$dr.state);
> - states[1] = state_char(lr_net$nr.state);
> - states[2] = state_char(lr_rpcclient$r.state);
> - states[3] = state_char(lr_swapspace$s.state);
> - states[4] = state_char(lr_ram$ram.state);
> - states[5] = state_char(lr_kmem$kmem.state);
> - states[6] = state_char(lr_cpu$cpu.state);
> - states[7] = state_char(lr_mutex$m.state);
> - states[8] = state_char(lr_dnlc$dnlc.state);
> - states[9] = state_char(lr_inode$inode.state);
> - states[10]= state_char(lr_tcp$tcp.state);
> + statetmp = lr_disk$dr.state; states[0] = state_char(statetmp);
> sum_states[0] = state_dig(statetmp);
> + statetmp = lr_net$nr.state; states[1] = state_char(statetmp);
> sum_states[2] = state_dig(statetmp);
> + statetmp = lr_rpcclient$r.state; states[2] = state_char(statetmp);
> sum_states[4] = state_dig(statetmp);
> + statetmp = lr_swapspace$s.state; states[3] = state_char(statetmp);
> sum_states[6] = state_dig(statetmp);
> + statetmp = lr_ram$ram.state; states[4] = state_char(statetmp);
> sum_states[8] = state_dig(statetmp);
> + statetmp = lr_kmem$kmem.state; states[5] = state_char(statetmp);
> sum_states[10] = state_dig(statetmp);
> + statetmp = lr_cpu$cpu.state; states[6] = state_char(statetmp);
> sum_states[12] = state_dig(statetmp);
> + statetmp = lr_mutex$m.state; states[7] = state_char(statetmp);
> sum_states[14] = state_dig(statetmp);
> + statetmp = lr_dnlc$dnlc.state; states[8] = state_char(statetmp);
> sum_states[16] = state_dig(statetmp);
> + statetmp = lr_inode$inode.state; states[9] = state_char(statetmp);
> sum_states[18] = state_dig(statetmp);
> + statetmp = lr_tcp$tcp.state; states[10]= state_char(statetmp);
> sum_states[20]= state_dig(statetmp);
>
> put_output(" timestamp", sprintf("%10d", now));
> put_output("locltime", tm_buf);
> put_output("DNnsrkcmdit", states);
> + put_output(" Dw Nw nw sw rw kw cw mw dw iw tw", sum_states);
> +// 0 1 2 3 4 5 6 7 8 9 10
> put_output(" uptime", sprintf("%8d", uptime));
> }
>
More information about the Orca-dev
mailing list