File: faq.html

package info (click to toggle)
cacti 0.8.6i-3
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 4,744 kB
  • ctags: 8,967
  • sloc: php: 39,760; sql: 2,306; xml: 678; sh: 487; perl: 133; makefile: 68
file content (346 lines) | stat: -rw-r--r-- 16,786 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
  <meta name="generator" content="HTML Tidy for Linux/x86 (vers 1st August 2004), see www.w3.org">

  <title>Frequently Asked Questions</title>
  <meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.79">
  <link rel="HOME" title="The Cacti Manual" href="index.html">
  <link rel="UP" title="Using Cacti" href="using_cacti.html">
  <link rel="PREVIOUS" title="Simplest Method of Going from Script to Graph (Walkthrough)" href="script_to_graph.html">
  <link rel="NEXT" title="Reference" href="reference.html">
  <link rel="STYLESHEET" type="text/css" href="manual.css">
</head>

<body class="CHAPTER" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084" alink="#0000FF">
  <div class="NAVHEADER">
    <table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <th colspan="3" align="center">The Cacti Manual</th>
      </tr>

      <tr>
        <td width="10%" align="left" valign="bottom"><a href="script_to_graph.html" accesskey="P">Prev</a></td>

        <td width="80%" align="center" valign="bottom"></td>

        <td width="10%" align="right" valign="bottom"><a href="reference.html" accesskey="N">Next</a></td>
      </tr>
    </table>
    <hr align="left" width="100%">
  </div>

  <div class="CHAPTER">
    <h1><a name="FAQ" id="FAQ"></a>Chapter 14. Frequently Asked Questions</h1>

    <div class="QANDASET">
      <dl>
        <dt>1. <a href="faq.html#AEN1824">Using Cacti</a></dt>

        <dd>
          <dl>
            <dt><a href="faq.html#AEN1827">How do I create traffic graphs?</a></dt>
          </dl>
        </dd>

        <dt>2. <a href="faq.html#AEN1854">General</a></dt>

        <dd>
          <dl>
            <dt><a href="faq.html#AEN1857">I get a "Undefined variable: _SERVER" error message from Cacti.</a></dt>

            <dt><a href="faq.html#AEN1862">I get a "Call to undefined function: mysql_connect()" error message from Cacti.</a></dt>

            <dt><a href="faq.html#AEN1867">I have forgotten my 'admin' password to Cacti, how do I reset it?</a></dt>
          </dl>
        </dd>

        <dt>3. <a href="faq.html#AEN1878">Monitoring</a></dt>

        <dd>
          <dl>
            <dt><a href="faq.html#AEN1881">I am polling thousands of items and poller.php takes more than 5 minutes to run.</a></dt>

            <dt><a href="faq.html#AEN1886">I changed x, and now some of my graphs are not updating.</a></dt>

            <dt><a href="faq.html#AEN1893">I am using <span class="APPLICATION">Redhat 8.0</span> and SNMP is not working.</a></dt>

            <dt><a href="faq.html#AEN1900">How do I configure <span class="APPLICATION">net-snmp</span> so it will work with Cacti?</a></dt>
          </dl>
        </dd>

        <dt>4. <a href="faq.html#AEN1911">Graphs</a></dt>

        <dd>
          <dl>
            <dt><a href="faq.html#AEN1914">I just installed Cacti and all of my graphs appear as broken images.</a></dt>

            <dt><a href="faq.html#AEN1927">My graphs render, but they do not contain any data.</a></dt>

            <dt><a href="faq.html#AEN1939">A lot of my graphs contain long ifAlias names, but they are being truncated to 15 characters.</a></dt>

            <dt><a href="faq.html#AEN1947">One of my devices rebooted and now I have a huge spike on my graph!</a></dt>

            <dt><a href="faq.html#AEN1956">RRDTool Says: ERROR: unknown option '--slope-mode' or RRDTool Says: ERROR: Garbage ':39:24 To 2005/10/22 16:39:24\c' after command: COMMENT:From 2005/10/21 16:39:24 To 2005/10/22 16:39:24\c</a></dt>
          </dl>
        </dd>

        <dt>5. <a href="faq.html#AEN1960">Windows Related</a></dt>

        <dd>
          <dl>
            <dt><a href="faq.html#AEN1963">I get a "Fatal error: Cannot redeclare title_trim()" error message from Cacti.</a></dt>
          </dl>
        </dd>
      </dl>

      <div class="QANDADIV">
        <h3><a name="AEN1824" id="AEN1824"></a>1. Using Cacti</h3>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1827" id="AEN1827"></a> How do I create traffic graphs?</p>
          </div>

          <div class="ANSWER">
            <p>Before you can create traffic graphs, Cacti must have working SNMP support. One way to do this is to compile PHP with SNMP support built in, many times you can install the 'php-snmp' package to do this. The second option is to have Cacti call the snmpget and snmpwalk binaries from your ucd-snmp or <span class="APPLICATION">net-snmp</span> installation. You can use the about page to determine whether to are using "built-in" or "external" SNMP support.</p>

            <p>Now that you have working SNMP support, follow these steps.</p>

            <ol type="1">
              <li>
                <p>Click <span class="GUILABEL">Devices</span> on Cacti's menu.</p>
              </li>

              <li>
                <p>Click <span class="GUILABEL">Add</span> to add a new device.</p>
              </li>

              <li>
                <p>Type a description, hostname, management IP, and SNMP community. Make sure to select "Generic SNMP-enabled Host" under <span class="GUILABEL">Host Template</span> and click <span class="GUILABEL">Create</span>.</p>
              </li>

              <li>
                <p>Click <span class="GUILABEL">Create Graphs for this Host</span> at the top of the page.</p>
              </li>

              <li>
                <p>You should see one or more interfaces listed under the <span class="GUILABEL">Data Query [SNMP - Interface Statistics]</span> box. Place a check next to each interface that you want to graph. Below the box, select type of graph that you want to create (bits, bytes, summation, etc).</p>
              </li>

              <li>
                <p>Click <span class="GUILABEL">Create</span>, and <span class="GUILABEL">Create</span> again on the following screen to create your graphs.</p>
              </li>
            </ol>
          </div>
        </div>
      </div>

      <div class="QANDADIV">
        <h3><a name="AEN1854" id="AEN1854"></a>2. General</h3>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1857" id="AEN1857"></a> I get a "Undefined variable: _SERVER" error message from Cacti.</p>
          </div>

          <div class="ANSWER">
            <p>Cacti 0.8.6 and above requires that you have at least PHP 4.1 or greater installed.</p>
          </div>
        </div>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1862" id="AEN1862"></a> I get a "Call to undefined function: mysql_connect()" error message from Cacti.</p>
          </div>

          <div class="ANSWER">
            <p>Your installation of PHP does not have MySQL installed or enabled. On binary-based distributions, make sure you have the 'php-mysql' package installed. Also make sure that 'extension=mysql.so' is uncommented in your php.ini file.</p>
          </div>
        </div>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1867" id="AEN1867"></a> I have forgotten my 'admin' password to Cacti, how do I reset it?</p>
          </div>

          <div class="ANSWER">
            <p>To reset the admin account password back to the default of 'admin', connect to your Cacti database at the command line.</p>
            <pre class="SCREEN">
<samp class="PROMPT">shell&gt;</samp> <kbd class="USERINPUT">mysql -u root -p cacti</kbd>
</pre>

            <p>Now execute the following SQL:</p>
            <pre class="SCREEN">
<samp class="PROMPT">mysql&gt;</samp> <kbd class="USERINPUT">update user_auth set password=md5('admin') where username='admin';</kbd>
</pre>
          </div>
        </div>
      </div>

      <div class="QANDADIV">
        <h3><a name="AEN1878" id="AEN1878"></a>3. Monitoring</h3>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1881" id="AEN1881"></a> I am polling thousands of items and poller.php takes more than 5 minutes to run.</p>
          </div>

          <div class="ANSWER">
            <p>Give cactid, the future replacement for poller.php a try. Unlike poller.php, cactid is written in c and makes use of pthreads. On a typical installation, it is not uncommon for cactid to poll about 500 items in less then 10 seconds.</p>
          </div>
        </div>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1886" id="AEN1886"></a> I changed x, and now some of my graphs are not updating.</p>
          </div>

          <div class="ANSWER">
            <p>The best thing to do here is to force Cacti to rebuild its poller cache. To do this click <span class="GUILABEL">Utilities</span> on the Cacti menu, and select <span class="GUILABEL">Clear Poller Cache</span>.</p>
          </div>
        </div>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1893" id="AEN1893"></a> I am using <span class="APPLICATION">Redhat 8.0</span> and SNMP is not working.</p>
          </div>

          <div class="ANSWER">
            <p><span class="APPLICATION">Redhat 8.0</span> comes with a broken php-snmp package. Updating your 'php-snmp' and 'net-snmp' packages to their latest versions should fix this problem.</p>
          </div>
        </div>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1900" id="AEN1900"></a> How do I configure <span class="APPLICATION">net-snmp</span> so it will work with Cacti?</p>
          </div>

          <div class="ANSWER">
            <p>Run <b class="COMMAND">snmpconf -g basic_setup</b> and follow the prompts. Also check that the file being used by snmpd is the correct config file. For Redhat Linux, snmpconf creates the <tt class="FILENAME">/etc/snmpd.conf</tt>, but snmpd uses <tt class="FILENAME">/etc/snmpd/snmpd.conf</tt>.</p>

            <p>If this doesn't work a very simple config file is:</p>
            <pre class="SCREEN">
<kbd class="USERINPUT"># contact
syslocation Something
syscontact "root@someone.com"

# auth
rocommunity public

# disk monitoring
disk /</kbd>
</pre>
          </div>
        </div>
      </div>

      <div class="QANDADIV">
        <h3><a name="AEN1911" id="AEN1911"></a>4. Graphs</h3>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1914" id="AEN1914"></a> I just installed Cacti and all of my graphs appear as broken images.</p>
          </div>

          <div class="ANSWER">
            <p>For you to actually get graph images, poller.php must run at least once so it can create .rrd files in Cacti's 'rra/' directory. Double check that you configured your <tt class="FILENAME">/etc/crontab</tt> file to execute poller.php every five minutes. Also make sure that the user poller.php runs as has permission to create new files in Cacti's 'rra/' directory.</p>

            <p>If all of your settings appear correct, try running poller.php manually by cd'ing to Cacti's directory and typing:</p>
            <pre class="SCREEN">
<samp class="PROMPT">shell&gt;</samp> <kbd class="USERINPUT">php poller.php</kbd>
</pre>

            <p>If you have files in your 'rra/' directory, but your graphs still appear as broken images, you should enable graph debug mode see exactly why the graphs are not rendering. To do this go into Cacti, select <span class="GUILABEL">Graph Management</span> from the menu, select any graph listed, and select <span class="GUILABEL">Turn On Graph Debug Mode</span>.</p>
          </div>
        </div>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1927" id="AEN1927"></a> My graphs render, but they do not contain any data.</p>
          </div>

          <div class="ANSWER">
            <p>More often than not, this problem's cause is permissions. For instance if you run poller.php manually as root for testing, any .rrd files that it creates will be owned by root. Now when poller.php runs from cron, it will not be able to update these .rrd files because they are owned by root. You can double check the owner of your .rrd files by running the following command in your Cacti directory:</p>
            <pre class="SCREEN">
<samp class="PROMPT">shell&gt;</samp> <kbd class="USERINPUT">ls -al rra/</kbd>
</pre>

            <p>If only some of your graphs are not updating correctly, double check the <span class="GUILABEL">Maximum Value</span> field for all data sources used by these graphs. If the value being fed to the .rrd file exceeds its <span class="GUILABEL">Maximum Value</span>, RRDTool will insert an <span class="GUILABEL">Unknown</span> and you will see no data on the graph.</p>
          </div>
        </div>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1939" id="AEN1939"></a> A lot of my graphs contain long ifAlias names, but they are being truncated to 15 characters.</p>
          </div>

          <div class="ANSWER">
            <p>Cacti does this by default to better control graph title formatting. You can change this limit, by going to <span class="GUILABEL">Cacti Settings</span> on the Cacti menu, selecting the <span class="GUILABEL">Visual</span> tab, and changing the value for <span class="GUILABEL">Data Queries - Maximum Field Length</span>.</p>
          </div>
        </div>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1947" id="AEN1947"></a> One of my devices rebooted and now I have a huge spike on my graph!</p>
          </div>

          <div class="ANSWER">
            <p>This occurs because the reboot causes SNMP's counters to reset, which can cause a rather large spike on the graph when <span class="APPLICATION">RRDTool</span> tries to determine the change between the new small counter value and the large previous value. One way to combat this issue is to specify realistic maximum values for your data sources. <span class="APPLICATION">RRDTool</span> will ignore any value that is larger than the maximum value.</p>

            <p>If you already have a spike on one or more of your graphs, there is a really <a href="http://cricket.sourceforge.net/contrib/files/killspike2" target="_top">useful Perl script</a> that will remove them for you.</p>
          </div>
        </div>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1956" id="AEN1956"></a> RRDTool Says: ERROR: unknown option '--slope-mode' or RRDTool Says: ERROR: Garbage ':39:24 To 2005/10/22 16:39:24\c' after command: COMMENT:From 2005/10/21 16:39:24 To 2005/10/22 16:39:24\c</p>
          </div>

          <div class="ANSWER">
            <p>This occurs because the version of RRDTool that you are running does not match the RRDTool version Cacti is configured to use. Double check your Cacti Settings and make sure that the RRDTool version matches what version of RRDTool you are running.</p>
          </div>
        </div>
      </div>

      <div class="QANDADIV">
        <h3><a name="AEN1960" id="AEN1960"></a>5. Windows Related</h3>

        <div class="QANDAENTRY">
          <div class="QUESTION">
            <p><a name="AEN1963" id="AEN1963"></a> I get a "Fatal error: Cannot redeclare title_trim()" error message from Cacti.</p>
          </div>

          <div class="ANSWER">
            <p>Contrary to previous versions of Cacti, you must not put Cacti in your PHP include path. Check your <tt class="FILENAME">php.ini</tt> file to make sure there is not something like <kbd class="USERINPUT">include_path = C:/Apache2/htdocs/cacti</kbd>.</p>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="NAVFOOTER">
    <hr align="left" width="100%">

    <table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="33%" align="left" valign="top"><a href="script_to_graph.html" accesskey="P">Prev</a></td>

        <td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">Home</a></td>

        <td width="33%" align="right" valign="top"><a href="reference.html" accesskey="N">Next</a></td>
      </tr>

      <tr>
        <td width="33%" align="left" valign="top">Simplest Method of Going from Script to Graph (Walkthrough)</td>

        <td width="34%" align="center" valign="top"><a href="using_cacti.html" accesskey="U">Up</a></td>

        <td width="33%" align="right" valign="top">Reference</td>
      </tr>
    </table>
  </div>
</body>
</html>