Re: [Nagios-users] status-txt: easier for other applications/services to use Nagios data
Hi, You could also use the mk_livestatus broker (available here http://mathias-kettner.de/checkmk_livestatus.html) which can be used to fetch information from Nagios in JSON format by forging your own requests. Best regards, Marc-André On 05/03/2012 05:57 AM, Wenhua Zhang wrote: Hi all, Recently, we need a API or application to get the nagios data as other easily readable format such as XML, JSON or plain text instead of the default HTML. status-txt is implemented to duplicate the output of status.cgi in plain text to achieve this goal, making it easier for other applications/services to use Nagios data. Compile status-txt.c to create status-txt.cgi, this cgi accepts exactly the same URL parameters that status.cgi accepts, and filters its output appropriately. In this version, it accepts almost all the arguments passed in the URL which status.cgi accepts except style, navbarsearch, columns and noheader. And we will add more functionalities in the next version. The status-txt.cgi will returns service data that appears in the status table of status.cgi as host_ip host_status [service:service_status;..], not includes the top portion of the page, eg: 196.0.0.1 UPHTTP_80:OK; 196.0.0.2 UPDB_PORT_3306:OK;DB_PORT_3307:OK; And you can use some arguments to filter its output, such as hostgroup, servicegroup, host and so on. The attachment is the source code, if you have any ideas about it, please feel free to let me know. You can also get the source code from github https://github.com/shiziwen/nagios-status2txt;. Thanks, Best Wishes, Wenhua -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
[Nagios-users] Exclude monitoring in holidays
Hey people! I don't want that nagios monitoring hosts/services in holidays that I specified. Does anyone know if is it possible, if so, how can I do that ? Many thanks! -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Exclude monitoring in holidays
http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#timeperiod From: Leonardo Bacha Abrantes [mailto:leona...@lbasolutions.com] Sent: 03 May 2012 13:03 To: nagios-users@lists.sourceforge.net Subject: [Nagios-users] Exclude monitoring in holidays Hey people! I don't want that nagios monitoring hosts/services in holidays that I specified. Does anyone know if is it possible, if so, how can I do that ? Many thanks! -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Exclude monitoring in holidays
On Thu, May 3, 2012 at 1:03 PM, Leonardo Bacha Abrantes leona...@lbasolutions.com wrote: Hey people! I don't want that nagios monitoring hosts/services in holidays that I specified. Does anyone know if is it possible, if so, how can I do that ? HI Leonardo, You could schedule downtime if you just dont want the alerts going out. Or disable the checks if you do not want them running at all. you can use a script that piped in the the Nagios command file to automate ether of the above. Ritchie, -- -- http://23.me.uk/2 -- --Time flies like an arrow; fruit flies like a banana. -- Many thanks! -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Exclude monitoring in holidays
You could probably set up a time period object with a series of exclusion dates. Have the check(s) run every day except the days you dont want to run. Or you could, just before the holiday in question, put the check into scheduled down time. That could be time consumong depending on how many hosts / checks you have Here is info on doing the time period set up http://nagios.sourceforge.net/docs/3_0/timeperiods.html http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#timeperiod Good Luck, Steve From: leona...@lbasolutions.com Date: Thu, 3 May 2012 09:03:19 -0300 To: nagios-users@lists.sourceforge.net Subject: [Nagios-users] Exclude monitoring in holidays Hey people! I don't want that nagios monitoring hosts/services in holidays that I specified. Does anyone know if is it possible, if so, how can I do that ? Many thanks! -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Exclude monitoring in holidays
Hey friends, many thanks! On Thu, May 3, 2012 at 10:18 AM, steve f a31mod...@hotmail.com wrote: You could probably set up a time period object with a series of exclusion dates. Have the check(s) run every day except the days you dont want to run. Or you could, just before the holiday in question, put the check into scheduled down time. That could be time consumong depending on how many hosts / checks you have Here is info on doing the time period set up http://nagios.sourceforge.net/docs/3_0/timeperiods.html http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#timeperiod Good Luck, Steve -- From: leona...@lbasolutions.com Date: Thu, 3 May 2012 09:03:19 -0300 To: nagios-users@lists.sourceforge.net Subject: [Nagios-users] Exclude monitoring in holidays Hey people! I don't want that nagios monitoring hosts/services in holidays that I specified. Does anyone know if is it possible, if so, how can I do that ? Many thanks! -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] Exclude monitoring in holidays
First you create a timeperiod which contains all the holidays you want to specify. I guess you already did that. Let's assume you called this timeperiod *myholidays*. Now you need to exclude this from your usual check timeperiod (24x7 by default): # This defines a timeperiod where all times are valid for checks, # notifications, etc. The classic 24x7 support nightmare. :-) define timeperiod{ timeperiod_name 24x7 alias 24 Hours A Day, 7 Days A Week exclude myholidays sunday 00:00-24:00 monday 00:00-24:00 tuesday 00:00-24:00 wednesday 00:00-24:00 thursday00:00-24:00 friday 00:00-24:00 saturday00:00-24:00 } As you see, the important configuration here is the exclude line. It's actually pretty easy and you can combine many exclusions like this. On Thu, May 3, 2012 at 2:03 PM, Leonardo Bacha Abrantes leona...@lbasolutions.com wrote: Hey people! I don't want that nagios monitoring hosts/services in holidays that I specified. Does anyone know if is it possible, if so, how can I do that ? Many thanks! -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] notifications
C. Bensend benny at bennyvision.com writes: I am using Nagios 3.3.1 I have got notifications by SMS working now Is there a way of defining what notifications go to email, what go to SMS and what can go to both. I personally would also find it interesting for SMS alerts only to notify a critical state *once* (even if emails are sent repeatedly due to notification_interval greater than 0). The SMS notifications obviously should include a recovery message. Not sure how to do this without setting up two completely separate service checks... -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] notifications
Marki, I use the following host and service escalations to do exactly that. It makes the first notification a text and email and subsequent problem alerts email only, then an email and SMS for recovery Don't know if it's the right way to do it but it works fine for me define hostescalation{ host_nameABC first_notification 1 last_notification 4 notification_interval 20 contact_groups Website Email escalation_options d,r } define hostescalation{ host_nameABC first_notification 1 last_notification 1 notification_interval 20 contact_groups Website sms escalation_options d } define hostescalation{ host_nameABC first_notification 1 last_notification 4 notification_interval 20 contact_groups Website sms escalation_options r } define hostescalation{ host_nameABC first_notification 5 last_notification 0 notification_interval 0 contact_groups Website Email escalation_options d,r } define hostescalation{ host_nameABC first_notification 5 last_notification 0 notification_interval 0 contact_groups Website sms escalation_options r } define serviceescalation{ host_nameABC service_descriptionSITE TRAWL first_notification 1 last_notification 4 notification_interval 20 contact_groups Website Email escalation_options c,r } define serviceescalation{ host_nameABC service_descriptionSITE TRAWL first_notification 1 last_notification 1 notification_interval 20 contact_groups Website sms escalation_options c } define serviceescalation{ host_nameABC service_descriptionSITE TRAWL first_notification 1 last_notification 4 notification_interval 20 contact_groups Website sms escalation_options r } define serviceescalation{ host_nameABC service_descriptionSITE TRAWL first_notification 5 last_notification 0 notification_interval 0 contact_groups Website Email escalation_options c,r } define serviceescalation{ host_nameABC service_descriptionSITE TRAWL first_notification 5 last_notification 0 notification_interval 0 contact_groups Website sms escalation_options r } -Original Message- From: Marki [mailto:jm+nagios-us...@roth.lu] Sent: 03 May 2012 16:45 To: nagios-users@lists.sourceforge.net Subject: Re: [Nagios-users] notifications C. Bensend benny at bennyvision.com writes: I am using Nagios 3.3.1 I have got notifications by SMS working now Is there a way of defining what notifications go to email, what go to SMS and what can go to both. I personally would also find it interesting for SMS alerts only to notify a critical state *once* (even if emails are sent repeatedly due to notification_interval greater than 0). The SMS notifications obviously should include a recovery message. Not sure how to do this without setting up two completely separate service checks... -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing list mailto:Nagios-users@lists.sourceforge.net Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will
Re: [Nagios-users] Exclude monitoring in holidays
Many thanks friends! :p On Thu, May 3, 2012 at 9:45 AM, Claudio Kuenzler c...@claudiokuenzler.comwrote: First you create a timeperiod which contains all the holidays you want to specify. I guess you already did that. Let's assume you called this timeperiod *myholidays*. Now you need to exclude this from your usual check timeperiod (24x7 by default): # This defines a timeperiod where all times are valid for checks, # notifications, etc. The classic 24x7 support nightmare. :-) define timeperiod{ timeperiod_name 24x7 alias 24 Hours A Day, 7 Days A Week exclude myholidays sunday 00:00-24:00 monday 00:00-24:00 tuesday 00:00-24:00 wednesday 00:00-24:00 thursday00:00-24:00 friday 00:00-24:00 saturday00:00-24:00 } As you see, the important configuration here is the exclude line. It's actually pretty easy and you can combine many exclusions like this. On Thu, May 3, 2012 at 2:03 PM, Leonardo Bacha Abrantes leona...@lbasolutions.com wrote: Hey people! I don't want that nagios monitoring hosts/services in holidays that I specified. Does anyone know if is it possible, if so, how can I do that ? Many thanks! -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
Re: [Nagios-users] status-txt: easier for other applications/services to use Nagios data
Hi, Thanks for your reply. As we know, MKLivestatus is a Nagios Event Broker (NEB) Module which can be used to extend the core of Nagios. This module can provide access to the live status information kept in the running Nagios process. It serves a unix socket for data exchange with external scripts/addons, it is stable and extremely fast. status-txt is a simple and light way to get the nagios data in plain text, it likes status-json ( http://exchange.nagios.org/directory/Addons/APIs/JSON/status-2Djson/details), try to making it easier for other applications/services to use Nagios data. I hope status-txt can be useful for those who have the same need as we did (try to get the nagios data as other easily readable format). Best Wishes, Wenhua 2012/5/3 MAD m...@b-care.net Hi, You could also use the mk_livestatus broker (available here http://mathias-kettner.de/checkmk_livestatus.html) which can be used to fetch information from Nagios in JSON format by forging your own requests. Best regards, Marc-André On 05/03/2012 05:57 AM, Wenhua Zhang wrote: Hi all, Recently, we need a API or application to get the nagios data as other easily readable format such as XML, JSON or plain text instead of the default HTML. status-txt is implemented to duplicate the output of status.cgi in plain text to achieve this goal, making it easier for other applications/services to use Nagios data. Compile status-txt.c to create status-txt.cgi, this cgi accepts exactly the same URL parameters that status.cgi accepts, and filters its output appropriately. In this version, it accepts almost all the arguments passed in the URL which status.cgi accepts except style, navbarsearch, columns and noheader. And we will add more functionalities in the next version. The status-txt.cgi will returns service data that appears in the status table of status.cgi as host_ip host_status [service:service_status;..], not includes the top portion of the page, eg: 196.0.0.1 UPHTTP_80:OK; 196.0.0.2 UPDB_PORT_3306:OK;DB_PORT_3307:OK; And you can use some arguments to filter its output, such as hostgroup, servicegroup, host and so on. The attachment is the source code, if you have any ideas about it, please feel free to let me know. You can also get the source code from githubhttps://github.com/shiziwen/nagios-status2txt; https://github.com/shiziwen/nagios-status2txt. Thanks, Best Wishes, Wenhua -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing listNagios-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null