Re: [Nagios-devel] Nagios dashboard...

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Nagios dashboard...

Post by Guest »

--=-T5rTDQemvmQj1ArNnEQu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Hiren,

>=20
> I'd be interested in seeing the patch for that dashboard, it could be=20
> useful for us. regarding an api for the cgi, I don't see why patches=20
> would not be considered if they didn't break compatibility.
>=20

attached is the patch...

HTH, cu l8r, Edgar.
--=20
''~``
( o o )
+-------------------------------------------------.oooO--(_)--Oooo.---+


--=-T5rTDQemvmQj1ArNnEQu
Content-Type: text/x-patch; charset=us-ascii; name=nagios-dashboard-3.0.6.patch
Content-Disposition: attachment; filename=nagios-dashboard-3.0.6.patch
Content-Transfer-Encoding: quoted-printable

diff -Naur nagios-3.0.6.old/cgi/Makefile.in nagios-3.0.6/cgi/Makefile.in
--- nagios-3.0.6.old/cgi/Makefile.in 2008-11-02 18:32:03.000000000 +0100
+++ nagios-3.0.6/cgi/Makefile.in 2009-04-29 13:41:10.000000000 +0200
@@ -24,6 +24,8 @@
=20
CGIEXTRAS=3D@CGIEXTRAS@
=20
+GDLIBS=3D-lgd
+
CP=3D@CP@
CC=3D@CC@
CFLAGS=3D@CFLAGS@ @DEFS@ @GLIB_INCLUDE@ -DNSCGI
@@ -155,7 +157,7 @@
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ showlog.c $(CGILIBS) $(LIBS)
=20
status.cgi: status.c $(CGIDEPS) $(CDATADEPS)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ status.c $(CGILIBS) $(CDATALIBS) $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ status.c $(CGILIBS) $(CDATALIBS) $(LIBS)=
$(GDLIBS)
=20
statuswml.cgi: statuswml.c $(CGIDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ statuswml.c $(CGILIBS) $(LIBS)
diff -Naur nagios-3.0.6.old/cgi/status.c nagios-3.0.6/cgi/status.c
--- nagios-3.0.6.old/cgi/status.c 2008-11-30 18:52:34.000000000 +0100
+++ nagios-3.0.6/cgi/status.c 2009-08-10 16:41:00.000000000 +0200
@@ -21,6 +21,19 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*************************************************************************=
/
=20
+
+/*
+ * Dashboard entries for nagios 3.0.6
+ */
+#include
+#include
+#include
+#include
+#include
+/*
+ * End dashboard
+ */
+
#include "../include/config.h"
#include "../include/common.h"
#include "../include/objects.h"
@@ -32,6 +45,17 @@
#include "../include/getcgi.h"
#include "../include/cgiauth.h"
=20
+/*
+ * Dashboard entries for nagios 3.0.6
+ */
+#define STATUS2_CGI "status2.cgi"
+#define FULL_IMG_PATH "/usr/local/nagios/share/dash-images"
+#define HTML_IMG_PATH "/nagios/dash-images"
+#define IMGSIZE 100
+/*
+ * End dashboard
+ */
+
extern int refresh_rate;
extern time_t program_start;
=20
@@ -78,6 +102,17 @@
#define STYLE_GRID 3
#define STYLE_HOST_DETAIL 4
=20
+/*
+ * Dashboard entries for nagios 3.0.6
+ */
+#define STYLE_DASHBOARD 5
+
+#define NR_ARG_HOSTS 4
+#define NR_ARG_SERVICES 5
+/*
+ * End dashboard
+ */
+
/* HOSTSORT structure */
typedef struct hostsort_struct{
hoststatus *hststatus;
@@ -123,6 +158,25 @@
void show_hostgroup_grids(void);
void show_hostgroup_grid(hostgroup *);
=20
+
+/*
+ * Dashboard entries for nagios 3.0.6
+ */
+void show_servicegroup_chart(servicegroup *);
+void show_hostgroup_chart(hostgroup *);
+void show_servicegroup_dashboard(void);
+void show_hostgroup_dashboard(void);
+void get_servicegroup_host_totals_summary(servicegroup *temp_servicegroup,=
int *r_up, int *r_down, int *r_unreachable, int *r_pending);
+void get_servicegroup_service_totals_summary(servicegroup *temp_servicegro=
up, int *r_ok, int *r_warning, int *r_unknown, int *r_critical, int *r_pend=
ing);
+void get_hostgroup_service_totals_summary(hostgroup *temp_hostgroup, int *=
r_ok, int *r_warning, int *r_unknown, int *r_critical, int *r_pending);
+void get_hostgroup_host_totals_summary(hostgroup *temp_hostgroup, int *r_u=
p, int *r_down, int *r_unreachable, int *r_pending);
+char *mkchart(char *type, int nr, ...);
+char *uniquepngfile (char *type);
+int getlargest (int i1, int i2, int i3, int i4, int i5);
+/*
+ * End dashboard
+ */
+
void show_filters(void);
=20
int passes_host_properties_filter(hoststatus *);
@@ -320,41 +374,41 @@
printf("View History For %

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked