dannywarren / cnagios Goto Github PK
View Code? Open in Web Editor NEWCurses-based interface for nagios
License: ISC License
Curses-based interface for nagios
License: ISC License
Welcome to Cnagios! Cnagios is a full-screen terminal interface for viewing Nagios HOST and SERVICE objects, and the durations of their current states. It's lightning fast because it's written in C using the curses library. And it's super flexible because it uses the perl C library to shorten and alter host, service and plugin output and filter the displayed HOSTs or SERVICEs. Download... https://github.com/dannywarren/cnagios/releases To use Cnagios, you'll need Unix, nagios, perl and the curses (or ncurses) libraries. To configure, build and install Cnagios, do... ./configure make make install If you want to install cnagios and it's man page in /usr/local then do "make install2". To run Cnagios, add "/usr/local/nagios/bin" to your PATH (or copy cnagios into /usr/bin) and do... cnagios If you don't like the full-color display, try... cnagios -b To launch Cnagios from your window manager, configure it to run color Cnagios in a wide xterm terminal with no scroll bar... my favorite invocation is... xterm +sb -geom 100x35 -rv -e \ /usr/local/nagios/bin/cnagios -s a -A 4h To modify the default/start-up configuration of cnagios, edit the /usr/local/nagios/etc/cnagiosrc and/or ~/.cnagiosrc file(s). You can also create permanent text (grep like) filters or negative (grep -v like) filters by editing the /usr/local/nagios/etc/cnagiosrc and/or ~/.cnagiosrc file(s). These filters are perl regular expressions. For example, the entry... f3 text =~ /IMAP|SMTP/ and hitting the "F3" key will cause cnagios to only display objects matching "IMAP" or "SMTP". To modify host, service and plugin output, edit the perl code in... /usr/local/nagios/etc/cnagios.pl Refer to... https://github.com/dannywarren/cnagios/blob/master/cnagios.pl for lots of examples. -- steve director of computing physics department university of wisconsin -- Steve died in his prime, on May 24, 2013. http://www.news.wisc.edu/21829 dan bradley physics department university of wisconsin -- Moved source from noc.hep.wisc.edu to github with the permission of Dan Bradley. https://github.com/dannywarren/cnagios
In "Last Change" column, there is "??? ??? ?? ??:??" string instead of date.
Debug output on start:
...
SERVICE NUMBER 109...
host_name is "pf-server"
raw service_description is "ZFS-BackupExist-pf-mon"
munged service_description is "pf-server ZFS-BackupExist-pf-mon"
current_state is OKAY
last_state_change is "??? ??? ?? ??:??" (1513893600)
duration is "34d 22h"
raw plugin_output is "OK"
munged plugin_output is "OK"
...
Platform: FreeBSD
Several of the build steps require a live running nagios instance to determine which version number to use.
This is only used to hardcode which status.dat parser cnagios should use at build time.
We should remove this dependency and instead make cnagios more of an on-demand nagios status file parsing utility.
This would require doing the following:
See:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212102
Somewhere after the release of nagios 3.5, cnagios started to segfault when reloading the status.dat file.
Backtrace from the segfault:
#0 0x0000000801754e00 in sbrk () from /lib/libc.so.7
#1 0x000000080175042e in sbrk () from /lib/libc.so.7
#2 0x00000008017507af in sbrk () from /lib/libc.so.7
#3 0x000000080175bdf5 in free () from /lib/libc.so.7
#4 0x0000000000404a8a in read_status () at read.c:90
#5 0x00000000004051df in getch_loop () at cmds.c:183
#6 0x0000000000403255 in main (argc=<value optimized out>, argv=<value optimized out>) at cnagios.c:253
Relevant section of read.c:
for ( i = 0; i < service_list_size; i++ ) {
for ( j = 0; j < STATUS_LIST_ENTRY_SIZE; j++ ) {
if ( j == LAST_UPDATE ) { continue; }
if ( j == LAST_STATE_CHANGE_INT ) { continue; }
free(service_list[i][j]);
service_list[i][j] = NULL;
}
}
Hi,
I start using cnagios for nagios 4 on centos 7 and in centos 6. all the dependencies installed and unfortunately, it doesn't comply on both centos 6 and 7.
Centos 7 :
[root@NAGIOS-01 cnagios-0.33]# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for cc... /usr/bin/cc
checking for perl... /usr/bin/perl
Can't locate ExtUtils/Embed.pm in @inc (@inc contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
Can't locate ExtUtils/Embed.pm in @inc (@inc contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
nagios etc dir... /etc/nagios
nagios var dir... /var/log/nagios
nagios status file... /var/log/nagios/status.dat
nagios data version... 4
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cnagios.h
./configure is done
next do "make"
then make doesn't work.
Centos 6.5 :
[root@nagios cnagios-0.33]# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for cc... NOT_FOUND
configure: error: can not continue: cc not found
[root@nagios cnagios-0.33]#
Thanks
Is there any chance the -s option could be modified to sort by status as well? If enough services or hosts are displayed that it it exceeds the display, I'd prefer that the most critical be sorted to the top of the list.
-s <n|a|s> sort objects by-name or by-age or by-status
Is there some other way to do this?
Localhost Cnagios v0.33 197 Service Objects Sat Jul 13 11:20:44
Age: ok < 25hr 10 match the filter Sort: by age
Filter: none page 1 of 1
Status Description Plugin Output Last Change Duration
-------- ---------------------------------------- ---------------- --------
OKAY fortis.rslegal.com Memory Usage used: Sat Jul 13 04:37 6h 42m
OKAY uni1.rslegal.com C:\ Drive Space 2 Gb ( Sat Jul 13 03:47 7h 33m
OKAY uni1.rslegal.com NSClient++ Version -14 Sat Jul 13 03:47 7h 33m
OKAY uni1.rslegal.com Uptime 7 hour(s) 27 mi Sat Jul 13 03:36 7h 44m
OKAY uni1.rslegal.com CPU Load min average) Sat Jul 13 03:36 7h 44m
OKAY uni1.rslegal.com Memory Usage - used: 2 Sat Jul 13 03:36 7h 44m
OKAY jupiter5.rslegal.com CPU Load average) Sat Jul 13 02:03 9h 17m
CRITICAL Sophos_UTM_9 Ashland KY Office P 71.28. Fri Jul 12 20:39 14h 41m
WARNING rq-core.rslegal.com H:\ Drive Space Gb Wed Jun 26 12:58 16d 22h
WARNING helios1.rslegal.com C:\ Drive Space Gb Wed Jun 5 04:38 38d 6h
The CRIT and WARN problems would be more visible and obvious at the top of the list.
Thank you!
This example work correctly for Icinga monitoring. Please add this to you manual.
./configure --with-etc-dir=/etc/icinga \
--with-var-dir=/var/lib/icinga \
--with-status-file=/var/lib/icinga/status.dat \
--with-nagios-data=3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.