help with the solution for the alert job

  • Hi,

    i need to monitor all my 70 servers that i'm responsible of(different company for every server).

    i setup a proc that check the cpu usage. i want to run it every 1 min

    and another proc that check every 15 min the avg of the results to see the cpu usage if it is high.

    and another proc that check the free available memory on the server.

    my question is - how i can setup the sql agent job to run the cpu and memory proc on the same job but cpu proc run every min and mem poc run every hour?

    p.s - maybe do you have a small free utility that do wht i need here not in sql server.(check cpu usage if it raise aboe XX% for XXSEC send alert and for the free mem available)

    THX

  • EXEC sp_cpu_proc

    IF (DATEPART(mi, GETDATE()) = '00')

    EXEC sp_memory_proc

    Add above code in job and schedule it for every 1 min.For CPU,it will work for every new hour( ex: 1 AM, 2 AM, 3 AM) .this is juat a one shot appraoch just came to my mind.So better do a test

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • thanks.

    another approach maybe someone have?

  • There is no other approach. You can add multiple schedules to a job, but you can't have those schedules run different steps of the job. It's all or nothing.

    If you want these steps on the same job, the only solution is to code them into procs and do the datetime check to verify what time it is when running the job.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply