sms alerts for vmware monitoring
sms alerts for vmware monitoring
Hi Team,
i am using the below mentioned command for sms alerts if a host is down and it works fine.
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " Infra says: $HOSTNAME$ is $HOSTSTATE$ Info is: $HOSTOUTPUT$ $LONGDATETIME$"'
i am using the box293_check_vmware.zip plugin with VMA for monitroring vmware infrastructure.
i have added a vcenter server and monitoring the datastores of the hosts under that.
i have set a threshold of warning free space 10GB and critical 5GB.
so i need an sms alert once it goes to critical.
so kindly help me in putting a command like i am using for host down mentioned above.
This is the vmware_datastore_usage command in nagios xi
$USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Datastore_Usage --name \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
i am using the below mentioned command for sms alerts if a host is down and it works fine.
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " Infra says: $HOSTNAME$ is $HOSTSTATE$ Info is: $HOSTOUTPUT$ $LONGDATETIME$"'
i am using the box293_check_vmware.zip plugin with VMA for monitroring vmware infrastructure.
i have added a vcenter server and monitoring the datastores of the hosts under that.
i have set a threshold of warning free space 10GB and critical 5GB.
so i need an sms alert once it goes to critical.
so kindly help me in putting a command like i am using for host down mentioned above.
This is the vmware_datastore_usage command in nagios xi
$USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Datastore_Usage --name \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: sms alerts for vmware monitoring
Great to see you using box293_check_vmware
It should be along the same lines but with service macros:
Here is a list of Nagios Macros:
http://nagios.sourceforge.net/docs/3_0/macrolist.html
It should be along the same lines but with service macros:
Code: Select all
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " Infra says: $HOSTNAME$ with service $SERVICEDESC$ is $SERVICESTATE$ with the outptut: $SERVICEOUTPUT$"'http://nagios.sourceforge.net/docs/3_0/macrolist.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: sms alerts for vmware monitoring
hi box_293,
thanks for your reply.
could you please tell me the exact macros which i need to put in the below lines for sending alerts for a datastore which goes critical as per the threshold as i find it a bit difficult to find out from the list.
thanks for your reply.
could you please tell me the exact macros which i need to put in the below lines for sending alerts for a datastore which goes critical as per the threshold as i find it a bit difficult to find out from the list.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: sms alerts for vmware monitoring
Here's an example command:
Here's the output:
Anything to the LEFT of the pipe | symbol is $SERVICEOUTPUT$
Anything to the RIGHT of the pipe | symbol is $SERVICEPERFDATA$
The perfdata string follows a format that can include the critical threshold value (2700 in this case). Refer to this documentation about how performance data is formatted:
https://nagios-plugins.org/doc/guidelines.html#AEN200
Code: Select all
./box293_check_vmware.pl --server vcenter.box293.local --check Datastore_Usage --host esxi001.box293.local --name VOL_02_03 --critical datastore_free:2700Code: 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
CRITICAL: Datastore 'VOL_02_03' {Free Space: 2,582.6 GB (CRITICAL <= 2,700)} {Used Space: 211.4 GB} {Capacity: 2,794 GB}Code: Select all
'Free Space'=2582.6GB;;2700 'Used Space'=211.4GB 'Capacity'=2794GB [Datastore_Usage]https://nagios-plugins.org/doc/guidelines.html#AEN200
There are no macros for the actual warning or critical thresholds. Nagios does not deal with that information, it simply executes a plugin with a bunch of arguments and receives back a result with an exit code.venkitesh wrote:could you please tell me the exact macros which i need to put in the below lines for sending alerts for a datastore which goes critical as per the threshold as i find it a bit difficult to find out from the list.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: sms alerts for vmware monitoring
hi box293,
Thanks for your reply.
so what you mean to say is we cant send an sms alert if a datastore is in critical threshold.
Thanks for your reply.
so what you mean to say is we cant send an sms alert if a datastore is in critical threshold.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: sms alerts for vmware monitoring
I think there is some confusion here. There is nothing special about the box293_check_vmware plugin and alerts being sent from nagios based on check results received from it. Yes you can send alerts when it reaches crtitical threshold.
The example command I gave you shows the --critical argument you could use for datastore_free.
Have you consulted the manual?
I'm not exactly sure if you have a problem with the plugin or if you don't know how to configure SMS in Nagios XI.
Bascially any service can send notifications via Email, SMS, or any other required means. This is built into Nagios XI.
Have you tried sending a notification test for the service?
Nagios XI
Search for the service
Click the service
Click the Advanced tab
Click the Send custom notification link
Follow the steps
You should receive the sms.
If you did not receive the SMS, is the contact assigned to the service under Core Configuration Manager?
How did you create the contact?
How have you configured Nagios XI to send SMS messages? Under Admin > System Config > Manage Mobile Carriers?
Have you configured the user account to allow SMS's to be sent to it? This is done by:
Login to Nagios XI as the user who you want the SMS to go to
Click the users name in the top right corner
Under Notification preferences
Are Enable notifications checked?
Are the relevant SMS options checked?
Under Notification Methods
Are Mobile Phone Text Messages enabled?
Have you populated the phone number?
The example command I gave you shows the --critical argument you could use for datastore_free.
Have you consulted the manual?
I'm not exactly sure if you have a problem with the plugin or if you don't know how to configure SMS in Nagios XI.
Bascially any service can send notifications via Email, SMS, or any other required means. This is built into Nagios XI.
Have you tried sending a notification test for the service?
Nagios XI
Search for the service
Click the service
Click the Advanced tab
Click the Send custom notification link
Follow the steps
You should receive the sms.
If you did not receive the SMS, is the contact assigned to the service under Core Configuration Manager?
How did you create the contact?
How have you configured Nagios XI to send SMS messages? Under Admin > System Config > Manage Mobile Carriers?
Have you configured the user account to allow SMS's to be sent to it? This is done by:
Login to Nagios XI as the user who you want the SMS to go to
Click the users name in the top right corner
Under Notification preferences
Are Enable notifications checked?
Are the relevant SMS options checked?
Under Notification Methods
Are Mobile Phone Text Messages enabled?
Have you populated the phone number?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: sms alerts for vmware monitoring
hi box293,
Sorry for the confusion.
lets make it simple.
i am able to send an sms alert from nagios xi when the a particular datastore has gone critical.
As i already told you, i am using the below mentioned command for sending sms when a datastore has gone critical which works fine.
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " INFRA Says: Datastore $HOSTNAME$ is: $HOSTOUTPUT$ MORE THAN 90% $LONGDATETIME$"'
the only challenge i am facing in the above command is datastore name is not fetching. i tried with a couple of macros, but its not happening.
Thanks
Sorry for the confusion.
lets make it simple.
i am able to send an sms alert from nagios xi when the a particular datastore has gone critical.
As i already told you, i am using the below mentioned command for sending sms when a datastore has gone critical which works fine.
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " INFRA Says: Datastore $HOSTNAME$ is: $HOSTOUTPUT$ MORE THAN 90% $LONGDATETIME$"'
the only challenge i am facing in the above command is datastore name is not fetching. i tried with a couple of macros, but its not happening.
Thanks
Re: sms alerts for vmware monitoring
Let's clarify - you have the following check set up on your Nagios XI server:
Why don't you send SMS alets via the "default" XI notifications methods?
Username->Notification Methods->Mobile Text
In the following command:
what is the 1.1.1.1 IP? Is this the XI server's IP? Can you elaborate on this command?
Code: Select all
$USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Datastore_Usage --name \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""Username->Notification Methods->Mobile Text
In the following command:
Code: Select all
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " INFRA Says: Datastore $HOSTNAME$ is: $HOSTOUTPUT$ MORE THAN 90% $LONGDATETIME$"'Be sure to check out our Knowledgebase for helpful articles and solutions!
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: sms alerts for vmware monitoring
Just to go back to basics.venkitesh wrote:As i already told you, i am using the below mentioned command for sending sms when a datastore has gone critical which works fine.
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " INFRA Says: Datastore $HOSTNAME$ is: $HOSTOUTPUT$ MORE THAN 90% $LONGDATETIME$"'
The VMware checks should be defined as a service.
Your commands are using HOST macros, there is no reference to the service macros that contain the service check output.
Which takes me back to my original reply:
Code: Select all
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " Infra says: $HOSTNAME$ with service $SERVICEDESC$ is $SERVICESTATE$ with the outptut: $SERVICEOUTPUT$"'I don't know where you thing the "datastore name should be fetched from". Please paste the Nagios Service definition so we can see it:venkitesh wrote:ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " INFRA Says: Datastore $HOSTNAME$ is: $HOSTOUTPUT$ MORE THAN 90% $LONGDATETIME$"'
the only challenge i am facing in the above command is datastore name is not fetching. i tried with a couple of macros, but its not happening.
Core Configuration Manager
Find the service
Click the Disk Icon
Paste the service definition here in a code block
ALSO, one other thing to keep in mind, SMS messages are historically restricted to 160 characters.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: sms alerts for vmware monitoring
hi lmiltchev
we have a linux based sms gateway(say 1.1.1.1) which we have integrated with nagios for sms alerting.
This is the vmware_datastore_usage command in nagios xi
$USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Datastore_Usage --name \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
command i used to send sms is
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " INFRA Says: Datastore $HOSTNAME$ is: $HOSTOUTPUT$ MORE THAN 90% $LONGDATETIME$"'
Output of this command will send an sms to the concerned number given in the above script that Some datastore has gone critical.
Say i have added one vcenter called testvc
under that i have added 2 datastores called testdatastore,testdatastore1
if any of this datastores has gone critical i will use the above sms script that Datastore testdatastore is critical more than 90%
the only issue we face is in the above sms script is datastore name(testdatastore) is not coming. only if we know which datastore has gone critical, then only we can take action right.
so just my request is what is the macro i have to use in the above script to get the datastores name.
Hope i mentioned my requirement exactly.
we have a linux based sms gateway(say 1.1.1.1) which we have integrated with nagios for sms alerting.
This is the vmware_datastore_usage command in nagios xi
$USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H $ARG1$ -C "~/box293_check_vmware.pl --timeout 90 --server $ARG2$ --check Datastore_Usage --name \"$ARG3$\" --reporting_si \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
command i used to send sms is
ssh [email protected] '/usr/bin/smssend +91-xxxxxxxxxx " INFRA Says: Datastore $HOSTNAME$ is: $HOSTOUTPUT$ MORE THAN 90% $LONGDATETIME$"'
Output of this command will send an sms to the concerned number given in the above script that Some datastore has gone critical.
Say i have added one vcenter called testvc
under that i have added 2 datastores called testdatastore,testdatastore1
if any of this datastores has gone critical i will use the above sms script that Datastore testdatastore is critical more than 90%
the only issue we face is in the above sms script is datastore name(testdatastore) is not coming. only if we know which datastore has gone critical, then only we can take action right.
so just my request is what is the macro i have to use in the above script to get the datastores name.
Hope i mentioned my requirement exactly.