Professional Web Applications Themes

admin newbie seeking script assistance - Linux / Unix Administration

I just recently joined a group of system administrators, after working for about 5 years in programming on OS/390. I have been asked to write a perl script to monitor httpd daemons over time, initially worried about the Size field in a ps -efl I started working on this by isolating what I wanted to look for with the following command: ps -efl | grep "httpd -k start" which seems to be getting what I wanted, but while I was getting this started, it occurred to me, there must be a billion other similar scripts out there as to what ...

  1. #1

    Default admin newbie seeking script assistance

    I just recently joined a group of system administrators, after working
    for about 5 years in programming on OS/390.

    I have been asked to write a perl script to monitor httpd daemons over
    time, initially worried about the Size field in a ps -efl

    I started working on this by isolating what I wanted to look for with
    the following command:

    ps -efl | grep "httpd -k start"

    which seems to be getting what I wanted, but while I was getting this
    started, it occurred to me, there must be a billion other similar
    scripts out there as to what I am about to start writing.

    Does anyone have anything like this? I realize it would actually be a
    good learning for me to start this from scratch, but the script is
    needed ASAP for aid in troubleshooting some production problems, and I
    would rather not have to do this from scratch if someone else has
    something that would work for our purposes and is relatively simple so
    I could modify as needed.

    Credit would be given to whomever helped me out. I'm not looking to
    impress anyone by getting it done faster than anticipated... I just
    want to have something soon so the guys working on the problem aren't
    being held up by me trying to learn the ins and outs of a new
    language/system.

    Any and all help is appreciated
    Brian Bouchard Guest

  2. #2

    Default Re: admin newbie seeking script assistance

    On 2 Aug 2004 09:05:46 -0700, Brian Bouchard <bbouchmcio.org> wrote:
    > I just recently joined a group of system administrators, after working
    > for about 5 years in programming on OS/390.
    >
    > I have been asked to write a perl script to monitor httpd daemons over
    > time, initially worried about the Size field in a ps -efl
    Well, I'd actually suggest using something like wget, lynx, or curl to
    fetch the http served by the webserver, rather than the output of ps.
    You can have processes that have gone stupid and still show up in
    ps, but not be actually doing anything useful.
    > ps -efl | grep "httpd -k start"
    >
    > which seems to be getting what I wanted, but while I was getting this
    > started, it occurred to me, there must be a billion other similar
    > scripts out there as to what I am about to start writing.
    Yup. Depending on what other things you want to do, you might consider
    using a program that's already written and spend your time adapting
    it. Big Brother comes to mind - [url]http://bb4.org/[/url]
    > Does anyone have anything like this? I realize it would actually be a
    > good learning for me to start this from scratch, but the script is
    > needed ASAP for aid in troubleshooting some production problems, and I
    > would rather not have to do this from scratch if someone else has
    > something that would work for our purposes and is relatively simple so
    > I could modify as needed.
    In that case, definately look at BigBrother. About a half day to install
    and config, assuming you have access to compilers.
    > Credit would be given to whomever helped me out. I'm not looking to
    > impress anyone by getting it done faster than anticipated... I just
    > want to have something soon so the guys working on the problem aren't
    > being held up by me trying to learn the ins and outs of a new
    > language/system.
    It'll be good to write a script well and quickly, maybe setting up a system
    that can be extended for more than just that purpose would be even more
    helpful to your organization and your reputation. Worth considering,
    anyway. But, if you want to roll your own, condider the wget, curl, or
    lynx approach rather than the ps approach.

    Dave Hinz

    Dave Hinz Guest

  3. #3

    Default Re: admin newbie seeking script assistance

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1
    NotDashEscaped: You need GnuPG to verify this message

    In comp.unix.admin Brian Bouchard <bbouchmcio.org> suggested:
    [..]
    > I have been asked to write a perl script to monitor httpd daemons over
    > time, initially worried about the Size field in a ps -efl
    Perl might be OTT for that.
    > I started working on this by isolating what I wanted to look for with
    > the following command:
    > ps -efl | grep "httpd -k start"
    ps -C httpd > /dev/null && echo "apache up" || echo "no apache"

    Should AFAIK work with a UNIX95 compliant ps in bash/ksh. Adjust
    to your needs.

    --
    Michael Heiming (GPG-Key ID: 0xEDD27B94)
    mail: echo [email]zvpunryurvzvat.qr[/email] | perl -pe 'y/a-z/n-za-m/'
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.4 (GNU/Linux)

    iD8DBQFBDng1AkPEju3Se5QRAvCVAKCQWEzYgPhjZsdSbAD6qF JDoyIpvwCdGHZB
    4lvw9S2PWmzwPOeifYdPQTU=
    =zIe4
    -----END PGP SIGNATURE-----
    Michael Heiming Guest

Similar Threads

  1. Newbie in need of desparate assistance
    By davidmedifit in forum Macromedia Flex General Discussion
    Replies: 5
    Last Post: April 8th, 11:04 PM
  2. seeking modem script for cdma cell phone
    By tristero in forum Mac Networking
    Replies: 0
    Last Post: September 12th, 02:24 PM
  3. newbie seeking opinion
    By Ken Robinson in forum PHP Development
    Replies: 3
    Last Post: September 8th, 06:05 PM
  4. Replies: 2
    Last Post: August 9th, 06:17 AM
  5. newbie seeking guidance
    By abacnet in forum ASP.NET General
    Replies: 1
    Last Post: August 4th, 03:53 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139