Page 1 of 1

Nagios Graph

Posted: Wed Jan 22, 2014 12:24 pm
by narendra.badgujar
Hi,

Nagios Graph error, , please support.

http://ServerIP/nagios/cgi-bin/show.cgi
No data in rrd directory /var/nagios/rrd.

http://ServerIP/nagios/cgi-bin/showconfig.cgi (Out put)

Code: Select all

nagiosgraph configuration on 172.21.0.150
09 Dec 2013 03:18:41 IST

PERL modules
 required 
 Carp: 1.04  
 CGI: 3.15  
 Data::Dumper: 2.121_08  
 File::Basename: 2.74  
 File::Find: 1.10  
 MIME::Base64: 3.07  
 POSIX: 1.09  
 RRDs: 1.3009  
 Time::HiRes: 1.9717  
 optional 
 GD: 2.46  

nagiosgraph
 ngshared.pm: ok  
 version: 1.4.4  
 nagiosgraph.conf: ok  
 RRD directory: ok  
 log file: ok  
 CGI log file: ok  
 map file: ok  

Environment
AUTH_TYPE=Basic
DOCUMENT_ROOT=/var/www/html
GATEWAY_INTERFACE=CGI/1.1
HTTP_ACCEPT=image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_ACCEPT_LANGUAGE=en-US
HTTP_CONNECTION=Keep-Alive
HTTP_HOST=172.21.0.150
HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.2)
PATH=/sbin:/usr/sbin:/bin:/usr/bin
QUERY_STRING=
REMOTE_ADDR=172.21.0.21
REMOTE_PORT=53618
REMOTE_USER=nagiosadmin
REQUEST_METHOD=GET
REQUEST_URI=/nagios/cgi-bin/showconfig.cgi
SCRIPT_FILENAME=/usr/local/nagios/sbin/showconfig.cgi
SCRIPT_NAME=/nagios/cgi-bin/showconfig.cgi
SERVER_ADDR=172.21.0.150
SERVER_ADMIN=root@localhost
SERVER_NAME=172.21.0.150
SERVER_PORT=80
SERVER_PROTOCOL=HTTP/1.1
SERVER_SIGNATURE=Apache/2.2.3 (CentOS) Server at 172.21.0.150 Port 80

SERVER_SOFTWARE=Apache/2.2.3 (CentOS)

Include Paths
/etc/nagiosgraph
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/5.8.8
.

base configuration
/etc/nagiosgraph/nagiosgraph.conf

altautoscale=
altautoscalemax=
altautoscalemaxsep=;
altautoscalemin=
altautoscaleminsep=;
altautoscalesep=,
cgilogfile=/var/log/nagiosgraph-cgi.log
colormax=888888
colormin=BBBBBB
colors=
  90d080
  30a030
  90c0e0
  304090
  ffc0ff
  a050a0
  ffc060
  c07020
colorscheme=9
dbseparator=subdir
debug=3
expand_timeall=day,week,month,year
expand_timegroup=day
expand_timehost=week
expand_timeservice=week
geometries=650x50,800x100,1000x200,2000x100
groupdb=/etc/nagiosgraph/groupdb.conf
heartbeat=600
hostservvar=
hostservvarsep=;
javascript=/nagiosgraph/nagiosgraph.js
lasts=
lineformat=warn=LINE1,D0D050;crit=LINE1,D05050
lineformatlist=
  warn=LINE1,D0D050
  crit=LINE1,D05050
logarithmic=
logarithmicsep=,
logfile=/var/log/nagiosgraph.log
mapfile=/etc/nagiosgraph/map
maximums=Current Load,.*;Current Users,.*;Total Processes,.*;PLW,.*
maximumslist=
  Current Load,.*
  Current Users,.*
  Total Processes,.*
  PLW,.*
minimums=
nagiosgraphcgiurl=/nagios/cgi-bin
nogridfit=
nogridfitsep=,
perflog=/var/nagios/perfdata.log
plotas=LINE2
plotasAREA=idle,data;system,data;user,data;nice,data
plotasAREAlist=
  idle,data
  system,data
  user,data
  nice,data
plotasLINE1=load5,data;load15,data
plotasLINE1list=
  load5,data
  load15,data
plotasLINE2=
plotasLINE3=
plotasTICK=
resolution=600 700 775 797
rrddir=/var/nagios/rrd
rrdoptshash=
  global=
showtitle=true
stack=system,data;user,data;nice,data
stacklist=
  system,data
  user,data
  nice,data
step=1 6 24 288
stepsize=300
stylesheet=/nagiosgraph/nagiosgraph.css
timeall=day,week,month,year
timeformat_day=%H:%M %e %b
timeformat_month=Week %U
timeformat_now=%H:%M:%S %d %b %Y %Z
timeformat_quarter=Week %U
timeformat_week=%e %b
timeformat_year=%b %Y
timegroup=day,week,month
timehost=day,week,month
timeservice=day,week,month
withmaximums=
  HTTP=1
  PING=1
withmaximumssep=,
withminimums=
  HTTP=1
  PING=1
withminimumssep=,
xff=0.5

map rules
/etc/nagiosgraph/map


/output:CHECK_NRPE: Socket timeout/
and return ('ignore');

/output:NRPE: Unable to read output/
and return ('ignore');

/output:CRITICAL - Socket timeout after/
and return ('ignore');

/output:CRITICAL - Plugin timed out after/
and return ('ignore');

/output:NTP CRITICAL: No response from NTP server/
and return ('ignore');

/output:Connection refused/
and return ('ignore');

/output:.*plugin may be missing/
and return ('ignore');

/output:.*Host Unreachable/
and return ('ignore');

/output:Connection to \S+ failed/
and return ('ignore');

/output:.*timed out waiting for/
and return ('ignore');


/perfdata:.*udpInDatagrams=(\d+), udpOutDatagrams=(\d+), udpInErrors=(\d+), tcpActiveOpens=(\d+), tcpPassiveOpens=(\d+), tcpAttemptFails=(\d+), tcpEstabResets=(\d+), tcpCurrEstab=(\d+), tcpOutDataBytes=(\d+), tcpInDataBytes=(\d+), tcpRetransBytes=(\d+)/
and push @s, [ 'udp',
               [ 'InPkts',  DERIVE, int $1/300 ],
               [ 'OutPkts', DERIVE, int $2/300 ],
               [ 'Errors',  DERIVE, int $3/300 ] ],
             [ 'tcp',
               [ 'ActOpens',    DERIVE, int $4/300    ],
               [ 'PsvOpens',    DERIVE, int $5/300    ],
               [ 'AttmptFails', DERIVE, int $6/300    ],
               [ 'OutBytes',    DERIVE, int $9/300*8  ],
               [ 'InBytes',     DERIVE, int $10/300*8 ] ];

(/output:NTP/ and /perfdata:\s*offset=/)
or
(/output:NTP.*Offset ([-.0-9]+).*jitter ([-.0-9]+).*stratum (\d+)/
and push @s, [ 'ntp',
               [ 'offset',  GAUGE, $1      ],
               [ 'jitter',  GAUGE, $2/1000 ],
               [ 'stratum', GAUGE, $3+1    ] ])
or
(/output:NTP.*Offset ([-.0-9]+) secs/
and push @s, [ 'ntp',
               [ 'offset',  GAUGE, $1 ] ]);

/output:.*uptime is.*?([.\d]+)\sDays/
and push @s, [ 'days',
               [ 'data', GAUGE, $1 ] ]
or (/output:.*uptime is.*?([.\d]+)\sHours/
    and push @s, [ 'days',
               [ 'data', GAUGE, $1/24 ] ])
or (/output:.*uptime is.*?([.\d]+)\sMinutes/
    and push @s, [ 'days',
               [ 'data', GAUGE, $1/1440 ] ]);

(/output:PROCS.*?(\d+) processes\n/ or
 /output:PROCS.*?(\d+) processes with STATE = RSZDT/)
and push @s, [ 'procs',
               [ 'data', GAUGE, $1 ] ];

/output:PROCS.*?(\d+) processes with STATE = Z/
and push @s, [ 'zombies',
               [ 'data', GAUGE, $1 ] ];

(! @s || $#s < 0) and /perfdata:(.+)/ and do {
    my $pd = $1;
    while ( $pd =~ s/([^=]+)=(\S+)// ) {
        my ($n,$y) = ($1,$2);
        next if (!defined $n || $n eq q());
        my ($v,$u,$x) = $y =~ /([-0-9.]+)([^;]*)(.*)/;
        next if (!defined $v || $v eq q());
        my ($w,$c,$min,$max);
        if (defined $x && $x ne q()) {
            $x =~ s/^;//;
            ($w,$c,$min,$max) = split /;/, $x;
        }
        $n =~ s/^\s+//g;
        $n =~ s/\s+$//g;
        $n =~ s/^\'//g;
        $n =~ s/\'$//g;
        $n =~ s/\'\'/\'/g;
        my ($wlo, $whi);
        if (defined $w && $w ne q()) {
            if ($w =~ /([-0-9.]+):([-0-9.]+)/) {
                $wlo = $1; $whi = $2; $w = q();
            } elsif ($w =~ /([-0-9.]+):/) {
                $whi = $1; $w = q();
            } elsif ($w =~ /:([-0-9.]+)/) {
                $wlo = $1; $w = q();
            }
        }
        my ($clo, $chi);
        if (defined $c && $c ne q()) {
            if ($c =~ /([-0-9.]+):([-0-9.]+)/) {
                $clo = $1; $chi = $2; $c = q();
            } elsif ($c =~ /([-0-9.]+):/) {
                $chi = $1; $c = q();
            } elsif ($c =~ /:([-0-9.]+)/) {
                $clo = $1; $c = q();
            }
        }
        my $t = 'GAUGE';
        if (defined $u) {
            my $mult = 1;
            if ($u eq 'c') {
                $t = 'DERIVE';
            } elsif ($u eq 's') {
                $mult = 1;
            } elsif ($u eq 'ms') {
                $mult = 1 / 1_000;
            } elsif ($u eq 'us') {
                $mult = 1 / 1_000_000;
            } elsif ($u eq 'B') {
                $mult = 1;
            } elsif ($u eq 'KB' || $u eq 'K' || $u eq 'kB') {
                $mult = 1024;
            } elsif ($u eq 'MB' || $u eq 'M' || $u eq 'mB') {
                $mult = 1024 * 1024;
            } elsif ($u eq 'GB' || $u eq 'G' || $u eq 'gB') {
                $mult = 1024 * 1024 * 1024;
            } elsif ($u eq 'TB' || $u eq 'T' || $u eq 'tB') {
                $mult = 1024 * 1024 * 1024 * 1024;
            } elsif ($u eq 'PB' || $u eq 'P' || $u eq 'pB') {
                $mult = 1024 * 1024 * 1024 * 1024 * 1024;
            }
            if ($mult != 1) {
                $v *= $mult;
                if ( defined $w && $w ne q()) { $w *= $mult; }
                if ( defined $c && $c ne q()) { $c *= $mult; }
                if ( defined $min && $min ne q()) { $min *= $mult; }
                if ( defined $max && $max ne q()) { $max *= $mult; }
                if ( defined $wlo && $wlo ne q()) { $wlo *= $mult; }
                if ( defined $whi && $whi ne q()) { $whi *= $mult; }
                if ( defined $clo && $clo ne q()) { $clo *= $mult; }
                if ( defined $chi && $chi ne q()) { $chi *= $mult; }
            }
        }
        my @x;
        push @x, [ 'data', $t, $v ];
        push @x, [ 'warn', $t, $w ] if defined $w && $w ne q();
        push @x, [ 'crit', $t, $c ] if defined $c && $c ne q();
        push @x, [ 'min', $t, $min ] if defined $min && $min ne q();
        push @x, [ 'max', $t, $max ] if defined $max && $max ne q();
        push @x, [ 'warn_lo', $t, $wlo ] if defined $wlo && $wlo ne q();
        push @x, [ 'warn_hi', $t, $whi ] if defined $whi && $whi ne q();
        push @x, [ 'crit_lo', $t, $clo ] if defined $clo && $clo ne q();
        push @x, [ 'crit_hi', $t, $chi ] if defined $chi && $chi ne q();
        push @s, [ $n, @x ];
    }
};

labels
labelfile is not defined
host settings
hostdb is not defined
service settings
servdb is not defined
group settings
/etc/nagiosgraph/groupdb.conf

PING=host1,PING&db=ping,rta
PING=host1,PING&db=ping,losspct
PING=host2,PING&db=ping,losspct
PING=host3,PING&db=ping,losspct
PING=host4,PING&db=ping,rta
PING=host4,PING&db=ping,losspct
PING=host5,PING&db=ping,losspct

Customer1=gateway1,PING&db=ping,rta
Customer1=host1,PING&db=ping,rta
Customer1=host1,HTTP&db=http
Customer1=mail1,SMTP: mailq&db=mailq,qsize

Customer2=gateway2,PING&db=ping,rta
Customer2=host2,PING&db=ping,rta
Customer2=host2,HTTP&db=http

Mail Servers=mail00,PING&db=ping,losspct
Mail Servers=mail00,SMTP: mailq&db=mailq,qsize
Mail Servers=mail01,PING&db=ping,losspct
Mail Servers=mail01,SMTP: mailq&db=mailq,qsize

Web Servers=http00,PING&db=ping,losspct
Web Servers=http00,HTTP&db=http
Web Servers=http01,PING&db=ping,losspct
Web Servers=http01,HTTP&db=http
Web Servers=http02,PING&db=ping,losspct
Web Servers=http02,HTTP&db=http

Backup=backup0,net&db=net,bytes-trasmitted&db=net,bytes-received
Backup=backup0,Partition: /&db=diskgb
Backup=backup1,net&db=net,bytes-trasmitted&db=net,bytes-received
Backup=backup1,Partition: /&db=diskgb

data sources
datasetdb is not defined
RRD options
rrdoptsfile is not defined
contents of config directory
/etc/nagiosgraph:
total 200
drwxr-xr-x   2 root root   4096 Dec  9 03:12 .
drwxr-xr-x 141 root root  12288 Dec  9 02:40 ..
-rw-r--r--   1 root root    879 Dec  9 02:30 access.conf
-rw-r--r--   1 root root    873 Dec  9 02:30 datasetdb.conf
-rw-r--r--   1 root root   2251 Dec  9 02:30 groupdb.conf
-rw-r--r--   1 root root   1446 Dec  9 02:30 hostdb.conf
-rw-r--r--   1 root root   1828 Dec  9 02:30 labels.conf
-rw-r--r--   1 root root   9836 Dec  9 02:30 map
-rw-r--r--   1 root root  14340 Dec  9 02:38 nagiosgraph.conf
-rw-r--r--   1 root root    793 Dec  9 02:30 nagiosgraph_de.conf
-rw-r--r--   1 root root    865 Dec  9 02:30 nagiosgraph_es.conf
-rw-r--r--   1 root root    935 Dec  9 02:30 nagiosgraph_fr.conf
-rw-r--r--   1 root root 107992 Dec  9 02:30 ngshared.pm
-rw-r--r--   1 root root    660 Dec  9 02:30 rrdopts.conf
-rw-r--r--   1 root root    480 Dec  9 02:30 servdb.conf


contents of RRD directory
/var/nagios/rrd:
total 8
drwxr-xr-x 2 nagios root 4096 Dec  9 02:39 .
drwxr-xr-x 3 root   root 4096 Dec  9 02:39 ..



Re: Nagios Graph

Posted: Wed Jan 22, 2014 5:29 pm
by slansing
Is this only happening to one of your hosts, or is it a service? Is this spread across the entire nagios server? Can you copy your host or service definition for this object and paste it here within codewraps? Was this a recently added object or did it just now stop showing graph output?