RRD not showing updating CPU, no cpustats



  • Running the Friday night release:

    # /usr/local/sbin/cpustats
    /usr/local/sbin/cpustats: Command not found.
    # find / -name "cpustats"
    #
    

    Guessing something to do with this:

    https://rcs.pfsense.org/projects/pfsense/repos/mainline/commits/e9e295f7c0c2e8a3c156a79db1311cae107c884c

    Is cpustats supposed to be there?



  • They switched to using cpustats for CPU statistics instead of top, but cpustats itself is missing from /usr/local/sbin/. ::)
    So it's definitely supposed to be there. :)



  • I confirm, no more cpu graphs from saturday morning (when I applied the upgrade) in RRD on the x64 version… :S



  • Same here, running: 2.0-RC1 (amd64) built on Sun Mar 20 20:00:56 EDT 2011
    "cpustats" not found on the system.

    enabling rdd graphs:
    Mar 21 11:55:13 check_reload_status: reloading filter
    Mar 21 11:55:48 apinger: Error while feeding rrdtool: Broken pipe
    Mar 21 11:56:48 apinger: /usr/local/bin/rrdtool respawning too fast, waiting 300s.

    So I'm running pfsense without rdd graphs.



  • I am beginning to believe weekend releases of Pfsense are LEMONS!  ::)

    Most of my bad experiences have been with weekend releases.

    RRD graphs broken for me on Pfsense 32 bit of Sunday.



  • @Tikimotel:

    Same here, running: 2.0-RC1 (amd64) built on Sun Mar 20 20:00:56 EDT 2011
    "cpustats" not found on the system.

    enabling rdd graphs:
    Mar 21 11:55:13 check_reload_status: reloading filter
    Mar 21 11:55:48 apinger: Error while feeding rrdtool: Broken pipe
    Mar 21 11:56:48 apinger: /usr/local/bin/rrdtool respawning too fast, waiting 300s.

    So I'm running pfsense without rdd graphs.

    This error messages not related to this issue. They used to be appear in system log from time to time long before this update. It's ok to run RRD with this error. At this moment more important thing is cpustats missing. I guess it can be just compiled on FreeBSD system with same architecture as your pfSense (x86/x64) and placed in /usr/local/sbin. But for now i have no PC with OS at hand.
    There is bug ticket regarding this issue: http://redmine.pfsense.org/issues/1365



  • Still no fix to this so suggest to put in /etc/inc/rrd.inc this:

    
    		/* the CPU stats gathering function. */
    			$rrdupdatesh .= "`$top -d 2 -s 1 0 | $awk '{gsub(/%/, \"\")} BEGIN { \\\n";
    			$rrdupdatesh .= "printf \"$rrdtool update $rrddbpath$ifname$proc \" } \\\n";
    			$rrdupdatesh .= "{ if ( \$2 == \"processes:\" ) { processes = \$1; } \\\n";
    			$rrdupdatesh .= "else if ( \$1 == \"CPU:\" ) { user = \$2; nice = \$4; sys = \$6; interrupt = \$8; } \\\n";
    			$rrdupdatesh .= "} END { printf \"N:\"user\":\"nice\":\"sys\":\"interrupt\":\"processes }'`\n\n";
    
    		/* End CPU statistics */
    
    

    instead of this:

    
    		/* the CPU stats gathering function. */
    			$rrdupdatesh .= "CPU=`$cpustats | cut -f1-4 -d':'`\n";
    		/* Using ps uxaH will count all processes including system threads. Top was undercounting. */
    			$rrdupdatesh .= "PROCS=`ps uxaH | wc -l | awk '{print \$1;}'`\n";
    			$rrdupdatesh .= "$rrdtool update $rrddbpath$ifname$proc N:\${CPU}:\${PROCS}\n";
    
    		/* End CPU statistics */
    
    

    Also you need to add this after $cpustats=…:

    
    	$cpustats = "/usr/local/sbin/cpustats";
    	$top = "/usr/bin/top";
    
    

    This will put old way to gather CPU stats back.



  • Warren Baker, updated the Bug report to feedback.
    BUT, the AMD64 builds are having trouble finding the kernel? (http://snapshots.pfsense.org/logs/pfSense_RELENG_2_0__FreeBSD_8/amd64/build.log)

    Wed Mar 23 02:55:59 EDT 2011 -|- *** Signal 15
    Wed Mar 23 02:56:00 EDT 2011 -|- Stop in /usr/home/pfsense/freesbie2.
    Wed Mar 23 02:56:00 EDT 2011 -|- >>> Kernel build for pfSense_wrap_Dev.8.amd64 started on Wed Mar 23 02:30:11 EDT 2011
    Wed Mar 23 02:56:00 EDT 2011 -|- >>> stage 1: configuring the kernel
    Wed Mar 23 02:56:00 EDT 2011 -|- >>> stage 2.2: rebuilding the object tree
    Wed Mar 23 02:56:00 EDT 2011 -|- >>> stage 2.3: build tools
    Wed Mar 23 02:56:00 EDT 2011 -|- >>> stage 3.1: making dependencies
    Wed Mar 23 02:56:00 EDT 2011 -|- >>> stage 3.2: building everything
    Wed Mar 23 02:56:00 EDT 2011 -|- >>> Installing wrap Dev kernel...
    Wed Mar 23 02:56:00 EDT 2011 -|- >>> KERNCONFDIR: /usr/pfSensesrc/src/sys/i386/conf
    Wed Mar 23 02:56:00 EDT 2011 -|- >>> ARCH:        amd64
    Wed Mar 23 02:56:00 EDT 2011 -|- >>> SRC_CONF:    src.conf.8
    Wed Mar 23 03:13:41 EDT 2011 -|- *** Signal 15
    Wed Mar 23 03:13:41 EDT 2011 -|- Stop in /usr/home/pfsense/freesbie2.
    Wed Mar 23 03:13:41 EDT 2011 -|- >>> Kernel build for pfSense_wrap_Dev.8.amd64 started on Wed Mar 23 02:55:59 EDT 2011
    Wed Mar 23 03:13:41 EDT 2011 -|- >>> stage 1: configuring the kernel
    Wed Mar 23 03:13:41 EDT 2011 -|- >>> stage 2.2: rebuilding the object tree
    Wed Mar 23 03:13:41 EDT 2011 -|- >>> stage 2.3: build tools
    Wed Mar 23 03:13:41 EDT 2011 -|- >>> stage 3.1: making dependencies
    Wed Mar 23 03:13:41 EDT 2011 -|- >>> stage 3.2: building everything
    Wed Mar 23 03:13:41 EDT 2011 -|- Could not locate /tmp/kernels/wrap_Dev/boot/kernel.gz
    Wed Mar 23 03:13:41 EDT 2011 -|- ####################################
    Wed Mar 23 03:13:42 EDT 2011 -|- ####################################
    


  • @Loke:

    This will put old way to gather CPU stats back.

    or just update to the latest snap.



  • @wagonza:

    @Loke:

    This will put old way to gather CPU stats back.

    or just update to the latest snap.

    When i wrote this there was no fix to this. Already fixed so this topic can be closed.


Locked