Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > Code & Utilities

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 24th April 2002, 22:58
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
Script for basic system information in HTML format

Recently I was asked to make some relevant system information available to other individuals (1st level support, management) in our company.
Rather than installing X servers across the board and use our BMC monitoring toolset, I wrote this little script that gives out some basic information (daemon status, disk usage, number of users and licenses, etc.).

The script outputs in HTML format, so it can easily be posted on the (intra)net. As a frame in a fully dressed up main page, it actually looks pretty nice.

I thought it was worth sharing. Let me know if you can think of any worthwhile additions to it (or better yet, POST your worthwhile additions).

Instructions: The damn thing _should_ just run and if not it _should_ tell you why not (a man can still dream, right?).
I am in no position to test this script on any other system than my own (solaris 2.5), so I depend on your feedback for fixes and improvements.
Create a header and footer file (html) if desired. The script will produce a file called adm_msg.html.
Schedule the scrip to run and ftp it to a webserver (or mail it out).

Thanks to Pat, Mark and Victor for their contributions so far.
Attached Files
File Type: ksh admin_info.ksh (7.2 KB, 397 views)
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas

Last edited by Francesco : 1st May 2002 at 01:52.
Reply With Quote
  #2  
Old 25th April 2002, 14:44
patvdv's Avatar
patvdv patvdv is offline
Board Master
 
Join Date: Aug 2001
Location: Belgium
Posts: 2,167
patvdv is on a distinguished road
Baan: n/a - DB: n/a - OS: AIX, HP-UX, Linux
Platform

Francesco,

It's a good script to share but I think it only runs really well on Solaris platforms as the 'du' command behaves differently under the various UNIX flavours. Opportunity for enhancements here :)

Also my KSH (HP-UX 11i) is tripping over the double equal bars '=='. I have never seen that before in KSH syntax!?

Thanks for posting it though!
__________________
Regards,

Patrick Van der Veken - Admin & Founder - (c) 2001-2017 baanboard.com/baanforums.com

Last edited by patvdv : 25th April 2002 at 22:16.
Reply With Quote
  #3  
Old 25th April 2002, 22:03
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
What can I say? I'm a Solaris kinda guy ;)

Thanks for the response, Pat.

Do you have any suggestions for a df alternative (or can you give me some different results)?

To the best of my knowledge, == is part of the '93 Korn shell, but I have been wrong before (...I remember it clearly, it was a cold October day in the late 70's...).

How would you substitute that line to make it run on your flavor?
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
  #4  
Old 25th April 2002, 22:26
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
On our system..

We are running Solaris and it almost worked just fine for me. The only problem I had was the bshell${TOOLSVERSION} and with the licd${TOOLSVERSION}. When I do a ps I see the bshells as plain old bshell and not bshell6.1. And when I tried the licd6.1 command it comes back with a message about branding the software. Do you need to be root or bsp to run this command?

Thanks for the post!

Mark
Reply With Quote
  #5  
Old 25th April 2002, 22:50
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
Re: On our system..

Quote:
Originally posted by mark_h
We are running Solaris and it almost worked just fine for me. The only problem I had was the bshell${TOOLSVERSION} and with the licd${TOOLSVERSION}. When I do a ps I see the bshells as plain old bshell and not bshell6.1.
Strange, that substitution should work. Did you change the line TOOLSVERSION=6.2 in TOOLSVERSION=6.1?

Quote:
And when I tried the licd6.1 command it comes back with a message about branding the software. Do you need to be root or bsp to run this command?


You need to be root to run licd6.1 (starting the license daemon), but that command is not in the script. It only looks if licd is an active process. The licmon6.1 command (if that's what you're referring to), does not require root normally, but of course the permissions can be set differently on your system.

Actually, it is a good idea to build in a permission scan and adjust the results accordingly.
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
  #6  
Old 25th April 2002, 23:21
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Ooops...

I did change the TOOLSVERSION from 6.2 to 6.1. Then I ran the script. I knew bshells were running so I just changed the BSHELL assignment to BSHELL="bshell". Worked just fine after that.

On the licd6.1 - oops. Did not look at this real close today. Anyway - I have looked for license daemons on both of our systems and do not see them. I did a grep on bsp,root, and lic. Did not find anything close to a licd6.1 running. As a matter of fact the only thing I see running with 6.1 is ipc_boot6.1 - one for each user.

Thanks

Mark
Reply With Quote
  #7  
Old 26th April 2002, 00:01
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
Re: Ooops...

No license daemon? shhhh....Baan's CEO reads this board these days ;)

ipc_boot6.1 must be the logon script you guys use to kick off the bshell. Does the bshell not use the 6.1 extension either? That would explain the first part not working.

I guess I'm a little out of my league here, not being very familiar with Baan versions between triton 2.0 and Baan Vb. There must be a license daemon out there somewhere on your network.

The script was built for a server running in strict host mode (mine). I never considered daemons running on different machines.

I can't think of a way to test daemons on a remote box off the top of my head. Suggestions are welcome.

Quote:
Originally posted by mark_h
I did change the TOOLSVERSION from 6.2 to 6.1. Then I ran the script. I knew bshells were running so I just changed the BSHELL assignment to BSHELL="bshell". Worked just fine after that.

On the licd6.1 - oops. Did not look at this real close today. Anyway - I have looked for license daemons on both of our systems and do not see them. I did a grep on bsp,root, and lic. Did not find anything close to a licd6.1 running. As a matter of fact the only thing I see running with 6.1 is ipc_boot6.1 - one for each user.

Thanks

Mark
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
Sponsored Links
  #8  
Old 26th April 2002, 00:52
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Your right...

Since you mentioned it - I do believe that we are running a separate license server. I know for most of our apps there is a application server, database server and a license server. And as far as I know all apps use the same license server. I do not have logon access to any of these puppies, so I can not check them. I wish more people at my company would use this board. Sigh.

Anyway I still appreciate the post.


Mark
Reply With Quote
  #9  
Old 26th April 2002, 10:55
patvdv's Avatar
patvdv patvdv is offline
Board Master
 
Join Date: Aug 2001
Location: Belgium
Posts: 2,167
patvdv is on a distinguished road
Baan: n/a - DB: n/a - OS: AIX, HP-UX, Linux
Quote:
Originally posted by Francesco
What can I say? I'm a Solaris kinda guy ;)

Thanks for the response, Pat.

Do you have any suggestions for a df alternative (or can you give me some different results)?

To the best of my knowledge, == is part of the '93 Korn shell, but I have been wrong before (...I remember it clearly, it was a cold October day in the late 70's...).

How would you substitute that line to make it run on your flavor?
I will be working on Solaris more as well in the future so it's time for me to start picking up some SUN books :)

As to df: the Solaris' 'df -kt' matches output of HP-UX's 'bdf'. So a simple check at the start of the script could set the correct 'df' command based on the running OS (uname -a)

As to the double bars: the KSH incarnation we run has no double bars so I am not sure as to which standard it adheres to (I just double-checked the man page). But then I checked O'Reilly's UNIX in a Nutshell for the KSH syntax and bingo you're right. It should support the C-style '=='. So I guess the anomaly is on the HP-UX side :) On HP-UX, it should be a single bar '='.

I will be writing shell scripts for cross UNIX platforms soon. It surely is going be fun to make then work on all!
__________________
Regards,

Patrick Van der Veken - Admin & Founder - (c) 2001-2017 baanboard.com/baanforums.com
Reply With Quote
  #10  
Old 26th April 2002, 11:06
victor_cleto's Avatar
victor_cleto victor_cleto is offline
Guru
 
Join Date: Aug 2001
Location: Portugal
Posts: 776
victor_cleto is on a distinguished road
Baan: none (B40c4 was last) - DB: Oracle - OS: Linux (RHEL)
Re: Re: Ooops...

Quote:
Originally posted by Francesco
ipc_boot6.1 must be the logon script you guys use to kick off the bshell. Does the bshell not use the 6.1 extension either? That would explain the first part not working.
...
I can't think of a way to test daemons on a remote box off the top of my head. Suggestions are welcome.
The ipc_boot6.1 it's the first binary that is called when a BW -> rexecd connection is made, this one reads the data from ipc_info and then starts the processes accordingly...

To check for other machines daemons, you could pick up the servers from the lib/licence6.1 file and then do remsh's/rexec's to the other machine(s).
Reply With Quote
  #11  
Old 29th April 2002, 19:33
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
Re: Re: Re: Ooops...

Quote:
Originally posted by victor_cleto


The ipc_boot6.1 it's the first binary that is called when a BW -> rexecd connection is made, this one reads the data from ipc_info and then starts the processes accordingly...
yea..umm..I meant to say that ;)

Quote:
To check for other machines daemons, you could pick up the servers from the lib/licence6.1 file and then do remsh's/rexec's to the other machine(s).
Excellent!! Easier said than done, but challenges are only successions for opportunists (or something like that). I'll get on it right away.
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
  #12  
Old 30th April 2002, 10:02
victor_cleto's Avatar
victor_cleto victor_cleto is offline
Guru
 
Join Date: Aug 2001
Location: Portugal
Posts: 776
victor_cleto is on a distinguished road
Baan: none (B40c4 was last) - DB: Oracle - OS: Linux (RHEL)
Build a script local_check.ksh that checks locally what you need and outputs to a file /tmp/check.<server_name>.

Then build a global_check.ksh one that calls the local_check.ksh [local info gathered], gets all the servers from the license6.x file and then does a rcp local_check.ksh to each server /tmp and then runs it there [remote run], then a rcp to get the output [other servers check].

Just join all the outputs /tmp/check.<server_name> into one and that's it, full servers information!
Reply With Quote
  #13  
Old 30th April 2002, 17:54
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
Lightbulb Script portability

I found this page that talks about portable scripts in the korn shell.
It mentions discrepancies between the '88 and '93 version as well as differences in operating systems and ksh flavors.
It even touches the = vs == issue. ;)

http://www.raycosoft.com/rayco/suppo...ting.html#korn

worth looking at.
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
  #14  
Old 30th April 2002, 20:19
patvdv's Avatar
patvdv patvdv is offline
Board Master
 
Join Date: Aug 2001
Location: Belgium
Posts: 2,167
patvdv is on a distinguished road
Baan: n/a - DB: n/a - OS: AIX, HP-UX, Linux
Good stuff

Thanks for posting that link Francesco! Some really interesting notes indeed. I was a bit surprised myself by the comments on the echo command. Ah well, back to square 1 :)
__________________
Regards,

Patrick Van der Veken - Admin & Founder - (c) 2001-2017 baanboard.com/baanforums.com
Reply With Quote
  #15  
Old 1st May 2002, 02:02
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
Version 2

I incorporated all you guys' suggestions.
With a little more insight in ksh portability (good luck to you, Pat. lol), I feel a lot better about this version.

The rexec option from Victor was nice, but then I found out that our system administrator has removed the rexec command for security reasons (he better leave the server alone), or at least...I couldn't find it.

Then I DUHd myself into using licmon's standard functionality and let it do the work for me.

Anyway...I uploaded the new and improved version. I got a ton of enhancement ideas and a lot of positive feedback, so this won't be the last.
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple date formats & currency formats by user. kphipps Tools Administration & Installation 6 9th November 2005 14:19
Maintain Generic Units ttaad1106m000 mark_h Tools Development 2 5th March 2004 14:43
NEW: vbcode CODE extensions patvdv About Baanboard.com 3 13th March 2003 11:19
Information System Development Eddie Monster Miscellaneous 2 3rd December 2002 00:57
Formats by Format Code Kai's Forum Users Deutsches Forum 2 11th October 2001 00:00


All times are GMT +2. The time now is 18:12.


©2001-2017 - Baanboard.com - Baanforums.com