Re: sms alerts for vmware monitoring
Posted: Tue Mar 10, 2015 11:49 am
venkitesh
Naigos plugins are simple in how they operate so that they can be flexible in how they're written. Nagios has no concept of what datastore you're checking unless you specify it. You can potentially use custom variables to achieve what you want but I think that goes beyond what is necessary to achieve your goal. Using Box293's sample output earlier, it has the data you want in it, you simply need to get that into your SMS:
If you concatenate $SERVICEOUTPUT$ and $LONGSERVICEOUTPUT$ you will always have all the data that is provided by the plugin back to Nagios. In this case it appears that the output that you want is on the first line so just using the $SERVICEOUTPUT$ macro should achieve your goal, as Box293 indicated:
If it is not, try adding in $LONGSERVICEOUTPUT$ then you have everything:
If adding both of those in doesn't get the data to your SMS system, it almost certainly would be a shortcoming of the SMS system.
One thing that might be helpful would be if we knew exactly what data was coming through in the SMS alerts for datastores. Can you share that?
Naigos plugins are simple in how they operate so that they can be flexible in how they're written. Nagios has no concept of what datastore you're checking unless you specify it. You can potentially use custom variables to achieve what you want but I think that goes beyond what is necessary to achieve your goal. Using Box293's sample output earlier, it has the data you want in it, you simply need to get that into your SMS:
Code: Select all
CRITICAL: Datastore 'VOL_02_03' {Free Space: 2,582.6 GB (CRITICAL <= 2,700)} {Used Space: 211.4 GB} {Capacity: 2,794 GB}|'Free Space'=2582.6GB;;2700 'Used Space'=211.4GB 'Capacity'=2794GB [Datastore_Usage]Code: Select all
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " Infra says: $HOSTNAME$ with service $SERVICEDESC$ is $SERVICESTATE$ with the outptut: $SERVICEOUTPUT$"'Code: Select all
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " Infra says: $HOSTNAME$ with service $SERVICEDESC$ is $SERVICESTATE$ with the outptut: $SERVICEOUTPUT$ \n $LONGSERVICEOUTPUT$"'One thing that might be helpful would be if we knew exactly what data was coming through in the SMS alerts for datastores. Can you share that?