in More Search Options

Advanced alerts and SQL statements

Last post 03-30-2008 8:45 AM by WINNT. 4 replies.
Page 1 of 1 (5 items)
Sort Posts:
  • 08-10-2007 12:35 PM

    Advanced alerts and SQL statements

    I would like to include recent syslog and events in my email events that are sent.  For instance, when cpu utilization is high, I would like to see the last 10 syslog messages from that server in the email that is sent. Here is my logic:

    Node Information:  

    Node: ${Node.Caption}
    IP Address:  ${Node.IP_Address}
    Node Type:  ${Node.MachineType}

    Memory Utilization:  ${Node.PercentMemoryUsed}
    Response Time:  ${Node.ResponseTime}

    Alert Infromation
    Alert Trigger time: ${AlertTriggerTime}
    Count:  ${AlertTriggerCount}
    Acknowledged:  ${Acknowledged}
    Acknowledged By:  ${AcknowledgedBy}
    acknowledged On:  ${AcknowledgedTime}

    Recent logs: 

    ${SQL:Select Top 25 * From SysLog where IP = '${Node.IP_Address}' and (DATETIME > (GETDATE()   - 7)) }

    This does not seem to work, is anyone doing this? 

    • Post Points: 3
  • 08-10-2007 2:33 PM In reply to

    • njoylif
    • Top 50 Contributor
    • Joined on 07-03-2007
    • Atlanta, GA
    • Posts 199
    • Points 417

    Re: Advanced alerts and SQL statements

    try it without the getdate() section and see if that piece works, then work on the issue from there, if it does.

    Actually, do you need the getdate if you are just pulling the top 25?  I haven't looked at that table.

    Larry J. Rice
    RelayHealth
    Network Architect
    678-984-1686
    • Post Points: 3
  • 08-30-2007 7:55 AM In reply to

    Re: Advanced alerts and SQL statements

    No the only thing that the SQL Statement will return is a single number (like the most recent syslog ID)  I wonder if they have setup the sql statement to only return a single value.   

    Filed under: ,
    • Post Points: 3
  • 03-26-2008 4:45 PM In reply to

    • ktucker
    • Top 200 Contributor
    • Joined on 11-28-2005
    • Posts 37
    • Points 94

    Re: Advanced alerts and SQL statements

    The email altert will limit the SQL query to 1 line output. So no wildcard searches on anything. This is limited to the email tool only from my experience.

    Would be great to get a multiple output of syslog and events from a single query.

     

    bye

    Ken

    Regards
    Ken
    • Post Points: 3
  • 03-30-2008 8:45 AM In reply to

    • WINNT
    • Top 75 Contributor
    • Joined on 06-22-2004
    • USA
    • Posts 99
    • Points 580

    Re: Advanced alerts and SQL statements

    I agree, this would be a great improvement. 

    In the meantime, I have had to create an alert action that launches an osql.exe / sqlcmd.exe query that will dump the results to a text file, which I then include in an e-mail sent by blat.exe or mailsend.exe.  It is a pain, especially formatting the SQL output, but it gets the job done.

    • Post Points: 1
Page 1 of 1 (5 items)