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] status-txt: easier for other applications/services to use Nagios data
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 UP HTTP_80:OK; 196.0.0.2 UP DB_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 /** * * STATUS-TXT.C - Nagios Status CGI * * Copyright (c) 1999-2009 Ethan Galstad (egals...@nagios.org) * Last Modified: 04-27-2012 * MM: Modified version of status CGI to provide TXT * * License: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "../include/config.h" #include "../include/common.h" #include "../include/objects.h" #include "../include/comments.h" #include "../include/macros.h" #include "../include/statusdata.h" #include "../include/cgiutils.h" #include "../include/getcgi.h" #include "../include/cgiauth.h" extern int refresh_rate; extern time_t program_start; extern char main_config_file[MAX_FILENAME_LENGTH]; extern char url_html_path[MAX_FILENAME_LENGTH]; extern char url_docs_path[MAX_FILENAME_LENGTH]; extern char url_images_path[MAX_FILENAME_LENGTH]; extern char url_stylesheets_path[MAX_FILENAME_LENGTH]; extern char url_logo_images_path[MAX_FILENAME_LENGTH]; extern char url_media_path[MAX_FILENAME_LENGTH]; extern char log_file[MAX_FILENAME_LENGTH]; extern char *notes_url_target; extern char *action_url_target; extern int suppress_alert_window; extern int enable_splunk_integration; extern host *host_list; extern service *service_list; extern hostgroup *hostgroup_list; extern servicegroup *servicegroup_list; extern hoststatus *hoststatus_list; extern servicestatus *servicestatus_list; #define MAX_MESSAGE_BUFFER 4096 #define DISPLAY_HOSTS 0 #define DISPLAY_HOSTGROUPS 1 #define DISPLAY_SERVICEGROUPS 2 /* HOSTSORT structure */ typedef struct hostsort_struct{ hoststatus *hststatus; struct hostsort_struct *next; }hostsort; /* SERVICESORT structure */ typedef struct servicesort_struct{ servicestatus *svcstatus; struct servicesort_struct *next; }servicesort; hostsort *hostsort_list=NULL; servicesort *servicesort_list=NULL; int sort_services(int,int); /* sorts services */ int compare_servicesort_entries(int,int,servicesort *,servicesort *); /* compares service sort entries */ void free_servicesort_list(void); void free_hostsort_list(void); void show_service_detail(void); int passes_host_properties_filter(hoststatus *); int passes_service_properties_filter(servicestatus *); void document_header(int); void document_footer(void); int process_cgivars(void); authdata current_authdata; time_t current_time; char *host_name=NULL; char *host_filter=NULL; char *hostgroup_name=NULL; char *servicegroup_name=NULL; char *service_filter=NULL; int show_all_hosts=TRUE; int show_all_hostgroups=TRUE; int show_all_servicegroups=TRUE; int display_type=DISPLAY_HOSTS; int overview_columns=3; int max_grid_width=8; int service_status_types=SERVICE_PENDING|SERVICE_OK|SERVICE_UNKNOWN|SERVICE_WARNING|SERVICE_CRITICAL; int all_service_status_types=SERVICE_PENDING|SERVICE_OK|SERVICE_UNKNOWN|SERVICE_WARNING|SERVICE_CRITICAL; int host_status_types=HOST_PENDING|HOST_UP|HOST_DOWN|HOST_UNREACHABLE; int all_
[Nagios-users] SOLVED: Re: puzzling no output from nrpe run of check_load
OK, I didn't wait long enough for the service to update, sorry. Changing the check_command definition to check_nrpe_1arg with the $HOSTADDRESS$ argument worked. It appears that the NRPE manual is incorrect on this. The examples it gives have just check_nrpe for argument-less commands on the remote server. That just consumed 3 hours or so, so quite painful. Sort of a bug in the documentation. How does one file a bug report on nagios? I couldn't find it at sourceforge or on www.nagios.org. I'm also happy to modify the source for the document if added as a developer on the sourceforge project (but the join link wasn't clear either). thanks, Peter On May 2, 2012, at 4:34 PM, Peter N. Steinmetz wrote: > I also just tried changing the service definition to > > # NRPE load check > define service { > use generic-service > host_name rm16 > service_description nrpe-load > check_command check_nrpe_1arg!check_load!$HOSTADDRESS$ > } > > but the same complaint is showing up in the server output for this service, > which seems a bit odd given then the command should now be check_nrpe_1arg > rather than check_nrpe. -- 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] puzzling no output from nrpe run of check_load
Continuing with this debugging. I think I understand the point about needing a shell permission to write output to the terminal window. I've now replaced the shell on the remote host with /bin/false and eliminated the password for the nagios user on the remote machine. If I leave the password and shell for the nagios user on the nagios server, I can execute the following there: sudo su nagios -c "/usr/lib/nagios/plugins/check_nrpe -H rm16 -c check_load" and I get the expected output. This would seem to imply that the nrpe daemon on the remote can run the check_load command and get output from it, passing it back to the nagios server, right? The configuration for the remote service on the nagios server is (in /etc/nagios3/conf.d/rm16.cfg): define service { use generic-service host_name rm16 service_description nrpe-load check_command check_nrpe!check_load } which appears to agree with the example on page 11 of the NRPE manual. Yet the nagios server is constantly showing: Current Status: UNKNOWN (for 7d 22h 37m 19s) Status Information: (No output returned from plugin) NRPE Plugin for Nagios for service state information on that remote host. The definition of the check_command seems right for a no argument command on the remote -- but is this wrong somehow? I also just tried changing the service definition to # NRPE load check define service { use generic-service host_name rm16 service_description nrpe-load check_command check_nrpe_1arg!check_load!$HOSTADDRESS$ } but the same complaint is showing up in the server output for this service, which seems a bit odd given then the command should now be check_nrpe_1arg rather than check_nrpe. thanks, Peter On Apr 30, 2012, at 10:56 AM, Eliezer Croitoru wrote: > so it seems that the check_load needs shell rights to show any output > what so ever also the --help stuff. > it's kind of understandable. > > Eliezer -- Peter N. Steinmetz, M.D.,Ph.D. Program Director, Neuroengineering Barrow Neurological Institute peternsteinm...@steinmetz.org 602-406-3258 http://steinmetz.org/peter -- 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] Nagios based distributed monitoring systems out there?
On 5/2/12 20:22, James Whittington wrote: > > I now am stuck with a system monitoring 1000 hosts across different locations > with a no low cost upgrade path under Opsview. > > What my company ultimately decides to do is not entirely up to me but I was > curious if other nagios based monitoring systems handled a reverse tunnel > master/slave distributed model as well as Opsview used to? > You should have a look at Mod-Gearman. It's a master/slave distribution system based on the Gearman MQ and gives you the possibility to spread out the checks to remote worker based on hostgroups, servicegroups and custom variables. -- 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] Nagios based distributed monitoring systems out there?
" what you mean by "reverse tunnel master/slave distributed model," So you have master server - that presents the master web interface - controls configs for everything -sends out notifications Slave servers are placed at remote locations to do active polling and results are returned to the master. Slave servers initiate ssh session to master and open up reverse tunnel back to itself. So data from slaves comes in via port 22, config data is pushed out to slaves over reverse ssh port. The cool thing is we don't have to deal with opening up ssh on a bunch of remote networks. As long as SSH is allowed out from remote networks and we allow in SSH from the remote networks everything just works. Other distributed setups I had seen had to have direct ssh access out from master to slave. Opsview Community edition was really a great value, but the move to enterprise edition would be a big cost increase, so I figured it was worth asking about distributed setup in other nagios based products. James -Original Message- From: Alex Griffin [mailto:agrif...@nagios.com] Sent: Wednesday, May 02, 2012 3:04 PM To: Nagios Users List Subject: Re: [Nagios-users] Nagios based distributed monitoring systems out there? I'm not sure how Opsview handles this or what you mean by "reverse tunnel master/slave distributed model," but there are several distributed monitoring solutions out there for Nagios. The two that come to mind for me are mod_gearman and dnx, but I'm certain I've seen others as well. Nagios XI integrates pretty well with DNX too. Alex Griffin --- Tech Team agrif...@nagios.com James Whittington wrote: > This is not entirely Nagios related, more nagios backend architecture > related. > > We had been a long time user of Opsview Community Edition. > > We were monitoring multiple sites so we were drawn in by Opsview's > ease of distributed server setup. > > Unfortunately Opsview is dropping distributed monitoring from the > community edition (a point brought up by Opsview sales when they > contacted us about buying enterprise). > > I now am stuck with a system monitoring 1000 hosts across different > locations with a no low cost upgrade path under Opsview. > > What my company ultimately decides to do is not entirely up to me but > I was curious if other nagios based monitoring systems handled a > reverse tunnel master/slave distributed model as well as Opsview used to? > > If Opsview is listening, next time you drop core features from your > product do your registered users a favor and give them advanced > notice, instead of using it as a sales talking point. > > Thanks. > > James > > > > -- > > 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
[Nagios-users] Unsubscribe
Unsubscribe -- 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] Nagios based distributed monitoring systems out there?
I'm not sure how Opsview handles this or what you mean by "reverse tunnel master/slave distributed model," but there are several distributed monitoring solutions out there for Nagios. The two that come to mind for me are mod_gearman and dnx, but I'm certain I've seen others as well. Nagios XI integrates pretty well with DNX too. Alex Griffin --- Tech Team agrif...@nagios.com James Whittington wrote: > This is not entirely Nagios related, more nagios backend architecture > related. > > We had been a long time user of Opsview Community Edition. > > We were monitoring multiple sites so we were drawn in by Opsview’s ease > of distributed server setup. > > Unfortunately Opsview is dropping distributed monitoring from the > community edition (a point brought up by Opsview sales when they > contacted us about buying enterprise). > > I now am stuck with a system monitoring 1000 hosts across different > locations with a no low cost upgrade path under Opsview. > > What my company ultimately decides to do is not entirely up to me but I > was curious if other nagios based monitoring systems handled a reverse > tunnel master/slave distributed model as well as Opsview used to? > > If Opsview is listening, next time you drop core features from your > product do your registered users a favor and give them advanced notice, > instead of using it as a sales talking point. > > Thanks. > > James > > > > -- > 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] Nagios based distributed monitoring systems out there?
This is not entirely Nagios related, more nagios backend architecture related. We had been a long time user of Opsview Community Edition. We were monitoring multiple sites so we were drawn in by Opsview's ease of distributed server setup. Unfortunately Opsview is dropping distributed monitoring from the community edition (a point brought up by Opsview sales when they contacted us about buying enterprise). I now am stuck with a system monitoring 1000 hosts across different locations with a no low cost upgrade path under Opsview. What my company ultimately decides to do is not entirely up to me but I was curious if other nagios based monitoring systems handled a reverse tunnel master/slave distributed model as well as Opsview used to? If Opsview is listening, next time you drop core features from your product do your registered users a favor and give them advanced notice, instead of using it as a sales talking point. Thanks. James -- 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
have a try on this: http://exchange.nagios.org/directory/Addons/Notifications/*-Notification-Managers/Rule-2DBased-Notifier/details On Tue, May 1, 2012 at 6:04 PM, Nick Price wrote: > 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 would like this to apply to escalations as well if possible > > > > > > Regards > > > > Nick > > > > > > > > > -- > 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