can run scripts from cmd line, but no output in cacti
Moderators: Developers, Moderators
can run scripts from cmd line, but no output in cacti
I think I am very close to getting this to work, but the graphs & rrd are not populating.
from shell:
[cactiuser@show scripts]$ cd /var/www/html/cacti/scripts/
[cactiuser@show scripts]$ ./sendmail.pl
11
copied from cacti console cron output
perl /var/www/html/cacti/scripts/sendmail.pl 11
here is a dump from the rrd file:
<!-- 2003-01-06 07:10:00 CST / 1041858600 --> <row><v> N
aN </v></row>
<!-- 2003-01-06 07:15:00 CST / 1041858900 --> <row><v> N
aN </v></row>
.....
Here is the data input info:
Name: Get number of Sendmail Procs
Input string: perl <path_cacti>/scripts/sendmail.pl
Output string: <Sendmail>
===============================
Current Data Input Source Fields
Name Data Name Input/Output Update RRA
Sendmail_procs sendmail Output Yes
=============================
Data Input Source Configuration
Name: Sendmail_procs
Data name: sendmail
Output selected and Use for RRA is checked
rrdtool Data Source Configuration
perl /var/www/html/cacti/scripts/sendmail.pl
/usr/local/rrdtool/bin/rrdtool update /var/www/html/cacti/rra/sendmail.rrd --template sendmail N:12
graph source output:
/usr/local/rrdtool/bin/rrdtool graph - \
--imgformat=PNG \
--start="-86400" \
--title="Sendmail Processes" \
--rigid \
--base=1000 \
--height=100 \
--width=400 \
--upper-limit=100 \
--lower-limit=0 \
--vertical-label="Sendmail Processes" \
DEF:a="/var/www/html/cacti/rra/sendmail.rrd":sendmail:AVERAGE \
AREA:a#FF0000:"Number of Processes" \
GPRINTLAST:"Current%8.2lf %s"
Thanks in advance for your help
from shell:
[cactiuser@show scripts]$ cd /var/www/html/cacti/scripts/
[cactiuser@show scripts]$ ./sendmail.pl
11
copied from cacti console cron output
perl /var/www/html/cacti/scripts/sendmail.pl 11
here is a dump from the rrd file:
<!-- 2003-01-06 07:10:00 CST / 1041858600 --> <row><v> N
aN </v></row>
<!-- 2003-01-06 07:15:00 CST / 1041858900 --> <row><v> N
aN </v></row>
.....
Here is the data input info:
Name: Get number of Sendmail Procs
Input string: perl <path_cacti>/scripts/sendmail.pl
Output string: <Sendmail>
===============================
Current Data Input Source Fields
Name Data Name Input/Output Update RRA
Sendmail_procs sendmail Output Yes
=============================
Data Input Source Configuration
Name: Sendmail_procs
Data name: sendmail
Output selected and Use for RRA is checked
rrdtool Data Source Configuration
perl /var/www/html/cacti/scripts/sendmail.pl
/usr/local/rrdtool/bin/rrdtool update /var/www/html/cacti/rra/sendmail.rrd --template sendmail N:12
graph source output:
/usr/local/rrdtool/bin/rrdtool graph - \
--imgformat=PNG \
--start="-86400" \
--title="Sendmail Processes" \
--rigid \
--base=1000 \
--height=100 \
--width=400 \
--upper-limit=100 \
--lower-limit=0 \
--vertical-label="Sendmail Processes" \
DEF:a="/var/www/html/cacti/rra/sendmail.rrd":sendmail:AVERAGE \
AREA:a#FF0000:"Number of Processes" \
GPRINTLAST:"Current%8.2lf %s"
Thanks in advance for your help
rrdtool dump results: top portion
/usr/local/rrdtool/bin/rrdtool dump sendmail.rrd |more
<!-- Round Robin Database Dump -->
<rrd>
<version> 0001 </version>
<step> 300 </step> <!-- Seconds -->
<lastupdate> 1042053942 </lastupdate> <!-- 2003-01-08 13:25:42 CST -->
<ds>
<name> sendmail </name>
<type> GAUGE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+00 </max>
<!-- PDP Status -->
<last_ds> UNKN </last_ds>
<value> 0.0000000000e+00 </value>
<unknown_sec> 42 </unknown_sec>
</ds>
<!-- Round Robin Archives -->
<rra>
<cf> AVERAGE </cf>
<pdp_per_row> 1 </pdp_per_row> <!-- 300 seconds -->
<xff> 5.0000000000e-01 </xff>
<cdp_prep>
<ds><value> NaN </value> <unknown_datapoints> 0 </unkno
wn_datapoints></ds>
</cdp_prep>
<database>
<!-- 2003-01-06 11:30:00 CST / 1041874200 --> <row><v> N
aN </v></row>
<!-- Round Robin Database Dump -->
<rrd>
<version> 0001 </version>
<step> 300 </step> <!-- Seconds -->
<lastupdate> 1042053942 </lastupdate> <!-- 2003-01-08 13:25:42 CST -->
<ds>
<name> sendmail </name>
<type> GAUGE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+00 </max>
<!-- PDP Status -->
<last_ds> UNKN </last_ds>
<value> 0.0000000000e+00 </value>
<unknown_sec> 42 </unknown_sec>
</ds>
<!-- Round Robin Archives -->
<rra>
<cf> AVERAGE </cf>
<pdp_per_row> 1 </pdp_per_row> <!-- 300 seconds -->
<xff> 5.0000000000e-01 </xff>
<cdp_prep>
<ds><value> NaN </value> <unknown_datapoints> 0 </unkno
wn_datapoints></ds>
</cdp_prep>
<database>
<!-- 2003-01-06 11:30:00 CST / 1041874200 --> <row><v> N
aN </v></row>
dump shows the same after changing max in DS
Just for grins, I changed the Max value from 20 to 500 in the Data Source field under cacti console and made sure to check update rra.
after 2 iterations of php cmd.php, the dump still shows the MAX as 1...
confused...
after 2 iterations of php cmd.php, the dump still shows the MAX as 1...
confused...
the rra and log dirs:
drwxrw-r-x 2 cactiuser users 12K Jan 8 13:56 rra
drwxrw-r-x 2 cactiuser users 4.0K Dec 27 15:45 log
the files within rra:
-rw-r--r-- 1 cactiuser users 47K Jan 8 14:10 sendmail.rrd
-rw-r--r-- 1 cactiuser users 138K Jan 8 14:10 system_loadavg.rrd
-rw-r--r-- 1 cactiuser users 47K Jan 8 14:10 system_mem_buffers.rrd
-rw-r--r-- 1 cactiuser users 47K Jan 8 14:10 system_mem_free.rrd
.....
So what you are saying is that apache needs to have write access as well as cactiuser? or users needs write access and apache needs to be in that group?
I am missing something..... other rrds are getting updated with the current ownership and perms...
drwxrw-r-x 2 cactiuser users 12K Jan 8 13:56 rra
drwxrw-r-x 2 cactiuser users 4.0K Dec 27 15:45 log
the files within rra:
-rw-r--r-- 1 cactiuser users 47K Jan 8 14:10 sendmail.rrd
-rw-r--r-- 1 cactiuser users 138K Jan 8 14:10 system_loadavg.rrd
-rw-r--r-- 1 cactiuser users 47K Jan 8 14:10 system_mem_buffers.rrd
-rw-r--r-- 1 cactiuser users 47K Jan 8 14:10 system_mem_free.rrd
.....
So what you are saying is that apache needs to have write access as well as cactiuser? or users needs write access and apache needs to be in that group?
I am missing something..... other rrds are getting updated with the current ownership and perms...
Ok, maybe I was not clear enough. All changes in rrd files (creation, updates) are performed by cmd.php. You are probably using cactiuser user in crontab to run cmd.php. There one exception when you change rrd file settings (like changing Maximum Value or DS Type). In this case apache updates the settings (not data) in rrd files. If your apache user has not rights to write in rrd directory then regardles of changes in cacti DS settings your rrd files remain unchanged.
Sumarizing - yes, both cactiuser and apache should have write rights in rrd directory.
- bulek
Sumarizing - yes, both cactiuser and apache should have write rights in rrd directory.
- bulek
got it!
I was able to modify the max value via rrdtool
/usr/local/rrdtool/bin/rrdtool tune sendmail.rrd --maximum sendmail:200
Sure enough, the graphs started showing after a few minutes.
Thank you for all your help and insight
/usr/local/rrdtool/bin/rrdtool tune sendmail.rrd --maximum sendmail:200
Sure enough, the graphs started showing after a few minutes.
Thank you for all your help and insight
Who is online
Users browsing this forum: No registered users and 2 guests