Как отобразить график только для рабочего времени с КАКТУСАМИ?

Попытайтесь добавить следующее к своей конфигурации Сайта Apache после всей конфигурации каталога.

Его полученный несколько правил обработать браузеры, которые борются с gzip, сжал веб-страницы.

<Location />
# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
7
задан 22 December 2012 в 13:37
3 ответа

У поллера CACTI заканчивается cron.

*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1

Если вы хотите проводить опрос только в рабочие часы, его можно настроить в cron, но rrdtool отобразит пробелы на графике, где выполняется опрос не проводилось.

-1
ответ дан 2 December 2019 в 23:53

Нет, rrdtool так не работает.

-2
ответ дан 2 December 2019 в 23:53

Most likely, Cacti itself isn't going to be able to generate this kind of graph for you. You're going to need to generate your RRD graph manually using rrdgraph. The full solution is quite complicated, but the basic gist is that you create a CDEF with an RPN equation that nulls out the data during non-business hours.

A very basic example that removes the hours 2012-01-31 18:00:00 UTC to 2012-02-01 08:00:00 UTC would be:

DEF:ds0=/path/to/data.rrd:ds0:AVERAGE
CDEF:officehours=TIME,1328032800,GT,0,1,IF,TIME,1328083200,LT,0,1,IF,MAX,1,UNKN,IF
CDEF:dslimit=ds0,officehours,*
AREA:dslimit#00cc00:"Value "

The CDEF for officehours basically checks to see if the time of the sample is between 6pm and 8am. If it is, the value is UNKN. If it isn't, the value is 1. Multiply that by the value and you're left with actual values during office hours and unknowns during non-office hours. A graph would show a hole during non-office hours, and averages, maxes, and mins output via GPRINT or PRINT would not factor in the non-office hour values.

You'll have to setup a CDEF for each non-office hour period you want to filter out. Time is in seconds since the epoch, so if you were graphing, say, January 1st to February 1st, you'd have on the order of 20 distinct periods you need to filter out. RRD has very good language hooks, so you could write a simple Perl or Python script to generate these graphs on the fly for you.

Read over the rrdgraph, rrdgraph_rpn, and rrdgraph_examples man pages for more details and examples.

3
ответ дан 2 December 2019 в 23:53

Теги

Похожие вопросы