Code Monkey home page Code Monkey logo

cnagios's People

Contributors

dannywarren avatar zedthree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cnagios's Issues

cnagios on centos

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

Remove dependencies on live nagios instance

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:

  • Removing --with-nagios-data and NAGIOS_STATUS_DATA_VERSION from configure
  • Remove NAGIOS_VERSION from headers
  • Add on-demand version parsing that can be used to determine when to call read_v1_status() vs read_v23_status()
  • Add command line flag for specifying the status.dat to parse (but still default to STATUS_DAT_FILE)
  • Add command line flag for overriding version parsing

See:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212102

Date formatting issue?

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

screenshot-2018 01 25-21 25 41-crop

Example configure for Icinga support

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

Segmentation fault when reloading nagios status

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;
  }
}

Feature request; addition to -s option

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.