Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

Welcome to Pandora FMS Community Forums Community support Can you trigger alerts of generic_data_string modules

  • Can you trigger alerts of generic_data_string modules

    Posted by mahna_wrfw on November 7, 2008 at 11:05

    I am just starting to get Pandora 2.0 configured and setting up some basic alerts.

    The Min value and Max value seem to require your module return a numeric value in order to trigger the alert(ex. generic_data). Is there a way to trigger an alert that also contains the text output from the commands being run(ex. generic_data_string)?

    I can get this alert to trigger for an agent.
    module_begin
    module_name SAP_Disk_95
    module_type generic_data
    module_exec df -Ph |egrep ‘9[5-9]%|100%’ |wc -l |awk -F” ” ‘{print $1}’
    module_description Check for disks over 94% full
    module_end

    I have setup an alert for this that tells me there is an agent that I need to check that has a disk that is close to full.

    min 0 ## Send an alert if there are any number of file systems
    max 0 ## over 94% full.
    _field1_ [email protected]
    _field2_ _agent_::SAP_Disk_95::Critical
    _field3_ There are _data_ disk(s) on host _agent_ are over 94% full. Please check.

    This will tell me the number of disks that are over 94% full. Is there also a way to include the name of the file systems?

    What I would like is to have a module that does:
    module_begin
    module_name SAP_Disk_95_names
    module_type generic_data_string
    module_exec df -Ph |egrep ‘9[5-9]%|100%’
    module_description List the disks over 94% full
    module_end

    I can get this to work and it will return an entry of:

    ussp-sap1:/vol/SAP/dvd/sapmedia 700G 663G 38G 98% /sapmedia

    What I would like to do is to trigger an alert that tells me:

    min ?? ## I’m not sure if I can even trigger an alert of a text value.
    max ?? ## I’m not sure if I can even trigger an alert of a text value.
    _field1_ [email protected]
    _field2_ _agent_::SAP_Disk_95::Critical
    _field3_ The following disk(s) on host _agent_ are over 94% full. _data_ Please check.

    This way I know what disks to go out and check. The /sapmedia getting full just means somone is installing and not cleaning up their files. ie. don’t worry and go back to bed. However if a sapdata or log file system gets full it means log in and get it fixed before anything fails.

    I am going through the documentation. I haven’t found anything yet that talks about sending an alert for a module that is of type “generic_data_string”. I still have a *lot* of the documentation to go through and a lot of threads on the wiki to go through. Maybe I need to be looking at plugins or WMI or SNMP. This is a very cool product, but I have a lot more to read.

    mahna_wrfw replied 16 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • manu

    Member
    November 7, 2008 at 14:20
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Yes, you can trigger an alert based on a string, you have to use the field: “Alert text” and leave the min max just blank

    And sorry, there’s no macro to inform you which filesystem is getting full, just the agent using _agent_

  • mahna_wrfw

    Member
    November 7, 2008 at 18:27
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Ok, that makes sense. I thought “Alert text” was just a description field. I didn’t think to try using it.

    I now have a module that does:

    module_begin
    module_name SAP_Disk_95_names
    module_type generic_data_string
    #This is what I ultimately want to use.
    #module_exec df -Ph |egrep ‘9[5-9]%|100%’
    # Just check them all for testing purposes.
    module_exec df -Ph |egrep ‘[ ,0-9][0-9]%|100%’
    module_description List the disks over 94% full
    module_end

    My eMail alert fields are setup with:
    Alert text: [/,a-z]
    # This finds all my local /[email protected]
    _field2_ _agent_::SAP_Disk_95::Critical
    _field3_ _data_

    This is is now sending me an alert listing all of the file systems on my agent. I think I will write a custom alert to format that data for me. This is exactly what I was looking for.

    Thank you for clarifying that.