Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am writing a custom munin plugin/graph and it's slightly computationally expensive. It's also unlikely to change much in a few minutes. Is it possible to have this one graph/plugin only update once per hour, and leave the rest of my graphs to update at the usual once per 5 minutes?

share|improve this question

3 Answers 3

I had a similar problem and had the real plugin in cron writing the data every hour to a temp file and then a reading plugin that ran every 5 minutes from munin, but only displayed the last line from the temp file.

share|improve this answer

A better way to do it is to change your munin so that graphs are generated on demand, not every five minutes.

This page appears to have an overview: http://waste.mandragor.org/munin_tutorial/munin.html#cgi

share|improve this answer

I had the same problem running munin on my Raspberry Pi. Since the Raspberry Pi is not that powerful it was having a lot of keeping up with the five intervals set up by Munin.

Edit the file /etc/cron.d/munin, add the following line:

2 * * * *      munin if [ -x /usr/bin/munin-graph ]; then /usr/bin/munin-graph; fi

The file /usr/bin/munin-graph does not exist yet, so we are going to create it:

vi /usr/bin/munin-graph

Now add this:

#!/bin/bash
# We always launch munin-html.
# It is a noop if html_strategy is "cgi"
nice /usr/share/munin/munin-html $@ || exit 1

# The result of munin-html is needed for munin-graph.
# It is a noop if graph_strategy is "cgi"
nice /usr/share/munin/munin-graph --cron $@ || exit 1 

and make it executable:

chmod +x /usr/bin/munin-graph

Now edit the /usr/bin/munin-cron file and comment out the lines we put in the munin-graph file:

[...]
# We always launch munin-html.
# It is a noop if html_strategy is "cgi"
# nice /usr/share/munin/munin-html $@ || exit 1

# The result of munin-html is needed for munin-graph.
# It is a noop if graph_strategy is "cgi"
# nice /usr/share/munin/munin-graph --cron $@ || exit 1 

By doing this, the munin-update runs every 5 minutes, and the graphing and HTML page creation runs only once per hour (2 minutes after the full hour).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.