EzDevInfo.com

cacti interview questions

Top cacti frequently asked interview questions

Is it possible to have SNMP Agent without MIB’s support?

hii, i am working on SNMP from last few days,i have develope a small application(SNMP Agent) which

* Run on 161 port.
* Have a tree structured OID support.
* Respond to all Get,GetNext,Set Pdu Request types.
* Tested with some SNMP Managers(free available) by get and set the values of the OID's.

BUT,now question is when i tried it with Cacti it will not respond anything,but detect windows snmp service..it just respond to the requests of the SNMP Managers.

So,Is it mandatory to provide mib with SNMP Agent??.


Source: (StackOverflow)

Server monitoring and alerting software? [closed]

What software does everyone use to monitor hardware? I know about nagios and cacti, but does anyone use any other software?


Source: (StackOverflow)

Advertisements

CentOS use SNMP to show interface useage

I have an SNMP monitoring box and want to monitor interface utilisation on a clustered database server. I'm trying to work out the correct OID to monitor - I just need SNMP to return the total interface throughput at a given time.

The SNMP box is already configured and will correctly graph it. All howtos I can find talk about setting up Catci or MRTG which is all well and good, but what I need seems simpler, yet I can't seem to find what I'm looking for. The SNMP box is already configured with the correct community name etc so this should be a really easy one in theory.

Any help very gratefully received

Thanks


Source: (StackOverflow)

Enable Cacti to monitor JMX

How do I configure CACTI to monitor values comming from JMX?


Source: (StackOverflow)

How to integrate freeipa with cacti?

I have a cacti and a freeipa server running fine. i want a user of cacti that is created from freeipa. i'm having a real pain. how to do it ? any step by step procedure or link can help


Source: (StackOverflow)

How to view RRD graph data

What I am trying to do is get alerts when my bandwidth goes above a limit. I am using Cacti to graph my bandwidth usage, but I currently get no alerts if my usage goes up.

So I think the best way to do this would be to write a script to check the graph data every say 5 mins.

Please can someone start me on the right track to this? I have looked online how to view the graphs but it gets very complicated for me.


Source: (StackOverflow)

apache server reached MaxClients setting, consider raising the MaxClients setting

I am running centos 5.5 with 768mb ram. i keep getting server reached MaxClients setting, consider raising the MaxClients setting in the logs also apache runs really slow. when i look at cacti graphs it shows the server is not even using all the resources.. here is the current configuration

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers    10
ServerLimit        1024
MaxClients         768
MaxRequestsPerChild  4000
</IfModule>

<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75 
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>



free -m
             total       used       free     shared    buffers     cached
Mem:           768        352        415          0          0         37
-/+ buffers/cache:        315        452
Swap:            0          0          0



top - 11:03:54 up 41 days, 11:53,  1 user,  load average: 0.05, 0.03, 0.00
Tasks:  35 total,   1 running,  34 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.3%st
Mem:    786432k total,   389744k used,   396688k free,        0k buffers
Swap:        0k total,        0k used,        0k free,    38284k cached

I have tried the following but the server responds very slowly

<IfModule worker.c>
#StartServers         2
#MaxClients         150
#MinSpareThreads     25
#MaxSpareThreads     75
#ThreadsPerChild     25
#MaxRequestsPerChild  0

StartServers    20
MaxClients      1024
ServerLimit     1024
MinSpareThreads 128
MaxSpareThreads 768
ThreadsPerChild 64
MaxRequestsPerChild 0
</IfModule>

free -m
             total       used       free     shared    buffers     cached
Mem:           768        324        443          0          0         37
-/+ buffers/cache:        286        481
Swap:            0          0          0

enter image description here

@regilero

I have updated to

<IfModule prefork.c>
  StartServers       12
  MinSpareServers    12
  MaxSpareServers    12
  MaxClients         50
  MaxRequestsPerChild  300
</IfModule>

using top i see

Tasks:  36 total,   1 running,  35 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.3%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    786432k total,   613180k used,   173252k free,        0k buffers
Swap:        0k total,        0k used,        0k free,    76488k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                                         
    1 root      20   0 10364   92   60 S  0.0  0.0   1:09.53 init                                                                                                                                                                            
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd/808                                                                                                                                                                    
    3 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper/808                                                                                                                                                                     
  124 root      16  -4 12620    8    4 S  0.0  0.0   0:00.00 udevd                                                                                                                                                                           
  533 root      20   0 95504 5692  228 S  0.0  0.7   4:02.94 memcached                                                                                                                                                                       
  546 root      20   0  5924  332  276 S  0.0  0.0   6:54.51 syslogd                                                                                                                                                                         
  557 root      20   0  101m 1456  868 S  0.0  0.2  13:18.64 snmpd                                                                                                                                                                           
  570 root      20   0 62640  316  208 S  0.0  0.0   2:39.56 sshd                                                                                                                                                                            
  579 root      20   0 21656   24   20 S  0.0  0.0   0:00.00 xinetd                                                                                                                                                                          
  589 root      20   0 12072   12    8 S  0.0  0.0   0:00.05 mysqld_safe                                                                                                                                                                     
  940 mysql     20   0  559m 164m 3832 S  0.3 21.5 209:33.88 mysqld                                                                                                                                                                          
 1015 root      20   0 20880  200  132 S  0.0  0.0   0:10.48 crond                                                                                                                                                                           
 1023 root      20   0 46748    4    0 S  0.0  0.0   0:00.00 saslauthd                                                                                                                                                                       
 1024 root      20   0 46748    4    0 S  0.0  0.0   0:00.00 saslauthd                                                                                                                                                                       
 3605 root      20   0 62832 2168  636 S  0.0  0.3   0:02.58 sendmail                                                                                                                                                                        
 3613 smmsp     20   0 57712 1648  504 S  0.0  0.2   0:00.01 sendmail                                                                                                                                                                        
17610 root      20   0 85932 3312 2600 S  0.0  0.4   0:00.02 sshd                                                                                                                                                                            
17612 mcmap     20   0 86072 1760 1012 S  0.0  0.2   0:00.17 sshd                                                                                                                                                                            
17613 mcmap     20   0 12076 1656 1292 S  0.0  0.2   0:00.01 bash                                                                                                                                                                            
17637 root      20   0 45052 1432 1120 S  0.0  0.2   0:00.00 su                                                                                                                                                                              
17638 root      20   0 12180 1800 1324 S  0.0  0.2   0:00.08 bash                                                                                                                                                                            
17740 root      20   0  246m 9264 4516 S  0.0  1.2   0:00.19 httpd                                                                                                                                                                           
18264 apache    20   0  282m  43m 4940 S  0.0  5.7   0:00.56 httpd                                                                                                                                                                           
18514 apache    20   0  279m  40m 4832 S  0.0  5.3   0:01.47 httpd                                                                                                                                                                           
18518 apache    20   0  273m  36m 4396 S  0.0  4.7   0:00.45 httpd                                                                                                                                                                           
18528 apache    20   0  251m  13m 3660 S  0.0  1.8   0:00.41 httpd                                                                                                                                                                           
18529 apache    20   0  278m  40m 4340 S  0.0  5.3   0:00.99 httpd                                                                                                                                                                           
18530 apache    20   0  278m  40m 4268 S  0.0  5.3   0:00.67 httpd                                                                                                                                                                           
18548 apache    20   0  272m  33m 3516 S  0.0  4.4   0:00.28 httpd                                                                                                                                                                           
18552 apache    20   0  280m  42m 3684 S  0.0  5.5   0:00.48 httpd                                                                                                                                                                           
18553 apache    20   0  271m  33m 3768 S  0.0  4.3   0:00.45 httpd                                                                                                                                                                           
18555 apache    20   0  274m  36m 3672 S  0.0  4.7   0:00.58 httpd                                                                                                                                                                           
18572 apache    20   0  247m 9020 2856 S  0.0  1.1   0:00.01 httpd                                                                                                                                                                           
18578 apache    20   0  280m  42m 3684 S  0.0  5.6   0:00.76 httpd                                                                                                                                                                           
18589 apache    20   0  246m 5452  676 S  0.0  0.7   0:00.00 httpd                                                                                                                                                                           
18588 root      20   0 12624 1216  932 R  0.0  0.2   0:00.06


free -m
             total       used       free     shared    buffers     cached
Mem:           768        578        189          0          0         74
-/+ buffers/cache:        504        263
Swap:            0          0          0

enter image description here Just added current picture of cacti result last 4 hours. busy periods are monday tuesday. So i will wait till next week to see further results of the config change. but it looks like an improvement as before i only had max 10 threads available. Looking at this do you think i can make more improvment?

free -m
             total       used       free     shared    buffers     cached
Mem:           768        619        148          0          0         49
-/+ buffers/cache:        570        197
Swap:            0          0          0

NEW TEST

On a 2GB Ram VPS box i have now set prefork to

StartServers      20
MinSpareServers   20
MaxSpareServers   20
ServerLimit  256
MaxClients   256
MaxRequestsPerChild  4000

today morning my memcache server died from

Nov 20 09:28:40 vps22899094 kernel: Out of memory: Kill process 12517 (memcached) score 81 or sacrifice child
Nov 20 09:28:40 vps22899094 kernel: Killed process 12517, UID 497, (memcached) total-vm:565252kB, anon-rss:42940kB, file-rss:44kB

What should the optimal values be to set in apache?

#/etc/sysconfig/memcached

PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="1024"
OPTIONS="-l 127.0.0.1"

/etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

bind-address=127.0.0.1

#script
thread_concurrency=2
query_cache_size = 16M
query_cache_type=1
query_cache_limit=5M

# MyISAM #
#key-buffer-size                = 32M
#myisam-recover                 = FORCE,BACKUP

# SAFETY #
#max-allowed-packet             = 16M
#max-connect-errors             = 1000000

# CACHES AND LIMITS #
tmp-table-size                 = 32M
max-heap-table-size            = 32M
#query-cache-type               = 0
#query-cache-size               = 0
max-connections                = 50
thread-cache-size              = 16
#open-files-limit               = 65535
#table-definition-cache         = 1024
#table-open-cache               = 2048

# INNODB #
#innodb-flush-method            = O_DIRECT
#innodb-log-files-in-group      = 2
#innodb-log-file-size           = 5M
#innodb-flush-log-at-trx-commit = 1
#innodb-file-per-table          = 1
#innodb-buffer-pool-size        = 921M
# LOGGING #
log-error                      = /var/log/mysqld.log
log-queries-not-using-indexes  = 1
slow-query-log                 = 1
slow-query-log-file            = /var/log/mysqld-slow.log

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Source: (StackOverflow)

Is it possible to use Cacti to monitor MySQL on Amazon's RDS?

I noticed that the instructions to setup cacti with mysql mention granting SUPER priveleges:

Create a MySQL user with the SUPER and PROCESS privileges on each server you want to monitor

However, it looks like using the Relational Database Service from Amazon (RDS), you cannot grant SUPER privileges. Does this mean I can't use cacti?

Thanks!


Source: (StackOverflow)

Cacti 0.8.8a / CentOS 6.4 / ERROR: opening '/usr/share/cacti/rra/*.rrd': No such file or directory

I've just installed Cacti 0.8.8a from EPEL repo of CentOS 6.4. Everything is fine except the graphs do not show up. I checked the log of httpd then I see:

ERROR: opening '/usr/share/cacti/rra/localhost_mem_buffers_3.rrd': No such file or directory
ERROR: opening '/usr/share/cacti/rra/localhost_proc_7.rrd': No such file or directory
ERROR: opening '/usr/share/cacti/rra/localhost_users_6.rrd': No such file or directory
ERROR: opening '/usr/share/cacti/rra/localhost_load_1min_5.rrd': No such file or directory

Seems like rrdtool did not generate those files.

This is in /usr/share/cacti

ls -ls /usr/share/cacti
total 872
 8 -rw-r--r-- 1 root  root   5945 Jun 28  2012 about.php
 8 -rw-r--r-- 1 root  root   5348 Jun 28  2012 auth_changepassword.php
16 -rw-r--r-- 1 root  root  14288 Jun 28  2012 auth_login.php
24 -rw-r--r-- 1 root  root  21658 Jun 28  2012 cdef.php
 0 lrwxrwxrwx 1 root  root     18 Jul 25 13:42 cli -> /var/lib/cacti/cli
28 -rwxr-xr-x 1 root  root  26620 Jun 28  2012 cmd.php
 8 -rw-r--r-- 1 root  root   6974 Jun 28  2012 color.php
28 -rw-r--r-- 1 root  root  25068 Jun 28  2012 data_input.php
36 -rw-r--r-- 1 root  root  35505 Jun 28  2012 data_queries.php
60 -rw-r--r-- 1 root  root  60117 Jun 28  2012 data_sources.php
36 -rw-r--r-- 1 root  root  32920 Jun 28  2012 data_templates.php
 8 -rw-r--r-- 1 root  root   6107 Jun 28  2012 gprint_presets.php
 4 -rw-r--r-- 1 root  root   3657 Jun 28  2012 graph_image.php
16 -rw-r--r-- 1 root  root  13469 Jun 28  2012 graph.php
12 -rw-r--r-- 1 root  root   9208 Jun 28  2012 graph_settings.php
20 -rw-r--r-- 1 root  root  17426 Jun 28  2012 graphs_items.php
40 -rw-r--r-- 1 root  root  40166 Jun 28  2012 graphs_new.php
60 -rw-r--r-- 1 root  root  60571 Jun 28  2012 graphs.php
12 -rw-r--r-- 1 root  root  10006 Jun 28  2012 graph_templates_inputs.php
20 -rw-r--r-- 1 root  root  18542 Jun 28  2012 graph_templates_items.php
28 -rw-r--r-- 1 root  root  26703 Jun 28  2012 graph_templates.php
40 -rw-r--r-- 1 root  root  40313 Jun 28  2012 graph_view.php
 8 -rw-r--r-- 1 root  root   6022 Jun 28  2012 graph_xport.php
60 -rw-r--r-- 1 root  root  60031 Jun 28  2012 host.php
20 -rw-r--r-- 1 root  root  20031 Jun 28  2012 host_templates.php
 4 drwxr-xr-x 2 root  root   4096 Jul 25 13:42 images
 4 drwxr-xr-x 4 cacti root   4096 Jul 25 13:50 include
 4 -rw-r--r-- 1 root  root   2313 Jun 28  2012 index.php
 4 drwxr-xr-x 2 root  root   4096 Jul 25 13:42 install
 4 drwxr-xr-x 3 root  root   4096 Jul 25 13:42 lib
 0 lrwxrwxrwx 1 root  root     15 Jul 25 13:42 log -> /var/log/cacti/
 4 -rw-r--r-- 1 root  root   2838 Jun 28  2012 logout.php
 4 drwxr-xr-x 2 root  root   4096 Jul 25 13:42 plugins
28 -rw-r--r-- 1 root  root  27362 Jun 28  2012 plugins.php
 8 -rw-r--r-- 1 root  root   4310 Jun 28  2012 poller_commands.php
 4 -rw-r--r-- 1 root  root   2243 Jun 28  2012 poller_export.php
20 -rwxr-xr-x 1 root  root  18056 Jun 28  2012 poller.php
 4 drwxr-xr-x 5 root  root   4096 Jul 25 13:42 resource
 **0 lrwxrwxrwx 1 cacti cacti    18 Jul 25 13:42 rra -> /var/lib/cacti/rra**
 8 -rw-r--r-- 1 root  root   7394 Jun 28  2012 rra.php
 0 lrwxrwxrwx 1 root  root     22 Jul 25 13:42 scripts -> /var/lib/cacti/scripts
12 -rw-r--r-- 1 root  root  10820 Jun 28  2012 script_server.php
 8 -rw-r--r-- 1 root  root   5761 Jun 28  2012 settings.php
 4 -rw-r--r-- 1 root  root   1407 Jun  3  2012 snmpv3_priv_proto_none.patch
 8 -rw-r--r-- 1 root  root   6345 Jun 28  2012 templates_export.php
 8 -rw-r--r-- 1 root  root   5835 Jun 28  2012 templates_import.php
20 -rw-r--r-- 1 root  root  19529 Jun 28  2012 tree.php
44 -rw-r--r-- 1 root  root  44997 Jun 28  2012 user_admin.php
68 -rw-r--r-- 1 root  root  65635 Jun 28  2012 utilities.php

I also changed the owner of rra folder to cacti user like this:

ls -ls /var/lib/cacti/
total 12
4 drwxr-xr-x 2 root  root 4096 Jul 25 13:42 cli
0 lrwxrwxrwx 1 root  root   24 Jul 25 13:42 include -> /usr/share/cacti/include
0 lrwxrwxrwx 1 cacti root   20 Jul 25 13:42 lib -> /usr/share/cacti/lib
**4 drwxr-xr-x 2 cacti cacti 4096 Jun 28  2012 rra**
4 drwxr-xr-x 2 root  root 4096 Jul 25 13:42 scripts

What should I do next? Thanks a lot!


Source: (StackOverflow)

Is it possible to access the Cacti RRD database over the network

is it possible to access the Cacti RRD (Round Robin Database) from a different machine over the network? We want to be able to create our own custom graphs by querying the Cacti RRD database (e.g. given a router hostname, give me the bandwidth usage on all its interfaces for the past 4 hours). So all we really want from Cacti is the raw data points required to build the graphs/plots. We don't need it to generate the graph images.

The Cacti service is deployed on a linux machine and the queries will be invoked from a Windows .Net application

Thanks!


Source: (StackOverflow)

How to multiple post PHP form onload for autologin cacti?

I have html and javascript code like this.

<form action="http://MYCACTI/cacti/logout.php" name="logout_cacti" method="post"></form> 
<form action="http://MYCACTI/cacti/" name="auth_cacti" method="post">
<input type="hidden" name="action" value="login">
<input type="hidden" name="realm" value="local">
<input type="hidden" name="login_username" value="guest">
<input type="hidden" name="login_password" value="guest">
</form> 
<script>
window.onload = PageLoad;
function PageLoad(){
    Logout();
    Login();
}
function Logout(){
    setTimeout(document.forms['logout_cacti'].submit(), 4000);
} 
function Login(){
    setTimeout(document.forms['auth_cacti'].submit(), 4000);
}
</script>

The question is, i want to make autologin cacti in iframe, and the problem is if the session in cacti is destroyed or if we already logout from cacti the script is working fine, it can go autologin to the site. But if we already login into cacti, there is an error display like this.

You are not permitted to access this section of Cacti. If you feel that you need access to this particular section, please contact the Cacti administrator.

I have implemented javascript window.onload but nothing successful, this is the output from firebug.

Firebug

Thank you.


Source: (StackOverflow)

Script runned by crontab will no produce data

Using Cacti, I'm trying to run the following command:

php poller.php > test.cfg

As expected I'm getting the following output :

root@SLINUX01:[/usr/local/cacti]$tail -f test.cfg
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
Waiting on 1 of 1 pollers.
05/12/2016 01:23:50 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/local/cacti/rra/stse01_traffic_in_14.rrd --template traffic_out:traffic_in 1463052230:2773678063:3900704413
05/12/2016 01:23:50 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/local/cacti/rra/stse01_traffic_in_15.rrd --template traffic_in:traffic_out 1463052230:1071486:1088742
05/12/2016 01:23:50 PM - SYSTEM STATS: Time:5.4128 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:9 RRDsProcessed:7
Loop  Time is: 5.41
Sleep Time is: 294.58
Total Time is: 5.42
^C

And my manipulated has updated.


Now using the crontab, I made the following :

*/5 * * * * cacti php /usr/local/cacti/poller.php > /home/cacti/test.cfg &>/home/cacti/test.cfg

But when i go in the /home/cacti/test.cfg after cron execution , I got nothing, but the cron runned the script :

May 12 15:25:01 SLINUX01 CROND[19871]: (root) CMD (cacti php /usr/local/cacti/poller.php > /home/cacti/test.cfg &>/home/cacti/test.cfg)

What is the source of this problem?

Thanks in advance.


Source: (StackOverflow)

MAMP : dyld: Symbol not found: __cg_jpeg_resync_to_restart Referenced from: /System/Library

I'm trying to run cacti on my Mac running OS X 10.9.3. I'm using MAMP 3.0.5.

In the cacti control panel, I've got the following error message :

dyld: Symbol not found: __cg_jpeg_resync_to_restart Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO Expected in: /Applications/MAMP/Library/lib/libJPEG.dylib in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO.


Source: (StackOverflow)

Creating and updating RRDs from Perl script and graph in Cacti

I'm slightly new to Perl, definitely new to RRDs, and I have a Perl script that runs some webservice tests and also retrieves lines from garbage collection logs. The script does other tasks as well but I only need to have a graph related to those two.

This piece of the script reads a results report .html, extracts some time values from a table and stores them in a variable.

my $html = "./report/archive/results-$now/web_results.html";
my @headers = qw( Page Initial Resource STB UI );
my $te = HTML::TableExtract->new(headers => \@headers);
$te->parse_file($html);
my ($table) = $te->tables;
for my $row ($te->rows) {
    my $pageDisplay = "@$row[0]";
    $pageDisplay =~ s/\D//g;

    my $initialLoad = "@$row[1]";
    $initialLoad =~ s/\D//g;

    my $resourceAudit = "@$row[2]";
    $resourceAudit =~ s/\D//g;

    my $uiRefresh = "@$row[3]";
    $uiRefresh =~ s/\D//g;

    my $stbRefresh = "@$row[4]";
    $stbRefresh =~ s/\D//g;
}

I would like to use RRDTool::OO or RRD::Simple to store these variables in an RRD and update them after each loop of the script.

I'd also like to do the same with another piece of the script that loops through some garbage collection log lines and returns a runtime for each.

open LOG,"<","./report/archive/logs-$now/garbage.collection.txt" or die "Unable to read file: $!";
    while (my $line = <LOG>) {
        my ($time) = $line =~ m/\breal=([0-9.]+)/;
    }
close LOG;

I believe RRDTool::OO has an update function that can be called with my variables, but my main problem is creating the RRD(s) to begin with so they can be updated with them. I'm not sure whether I need to have more than one RRD, what step value would be best, data sources, etc..

If I can get the RRD or RRDs created/updated successfully I'm pretty sure I can follow Cacti's Externally Updated RRDs doc to get them loaded onto cacti to be graphed. Although someone may have a better approach. Any help is appreciated!

EDIT

I've tried the following on the second part of my script...

#RRDTool::OO

my $rrd = RRDTool::OO->new(
             file => "gcRuntimes.rrd" );

$rrd->create(
     step        => 1,
     data_source => { name      => "GC",
                      type      => "GAUGE" },
     archive     => { rows      => 50 });
...

open LOG,"<","./report/archive/logs-$now/garbage.collection.txt" or die "Unable to read file: $!";
    while (my $line = <LOG>) {
        my ($time) = $line =~ m/\breal=([0-9.]+)/;
        $rrd->update($time);
}
close LOG;

..But that fails with an error: rrdtool create gcRuntimes.rrd --step 1 DS:GC:GAUGE:2:U:U RRA:MAX:0.5:1:5 failed: creating 'gcRuntimes.rrd': Invalid argument at /home/foo/perl5/lib/perl5/RRDTool/OO.pm line 438

Running strace with my script will show this (invalid argument) at the mmap2 syscall.

mmap2(NULL, 1344, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = -1 EINVAL (Invalid argument)
close(3)

It doesn't matter to me if I use RRD::Simple or RRDTool::OO, but currently they both return the same error.


Source: (StackOverflow)

printing number of snmpwalk results

Were trying to make a script on a Ubuntu server that reads the number of results from an snmpwalk command, and then sending it to Cacti for graphing.

Since none of us have any kind of programming knowledge and from what we have tried, we havent succeed.

It will go like this:

the script runs: snmpwalk -v 1 -c public -Cp 10.59.193.141 .1.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1

The command will print

iso.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1.0.34.250.121.174.124 = Hex-STRING: 00 22 FA 79 AE 7C
iso.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1.0.35.20.11.246.64 = Hex-STRING: 00 23 14 0B F6 40
iso.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1.0.38.198.89.34.192 = Hex-STRING: 00 26 C6 59 22 C0
iso.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1.40.224.44.221.222.148 = Hex-STRING: 28 E0 2C DD DE 94
iso.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1.100.163.203.10.120.83 = Hex-STRING: 64 A3 CB 0A 78 53
iso.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1.120.214.240.8.133.165 = Hex-STRING: 78 D6 F0 08 85 A5
iso.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1.132.0.210.179.213.93 = Hex-STRING: 84 00 D2 B3 D5 5D
iso.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1.132.0.210.201.8.196 = Hex-STRING: 84 00 D2 C9 08 C4
iso.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1.140.112.90.108.236.188 = Hex-STRING: 8C 70 5A 6C EC BC
iso.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1.140.112.90.139.18.244 = Hex-STRING: 8C 70 5A 8B 12 F4
iso.3.6.1.4.1.11.2.14.11.6.4.1.1.8.1.1.2.1.180.240.171.112.37.69 = Hex-STRING: B4 F0 AB 70 25 45
Variables found: 11

Then the script should somehow do: read until Variables found: and read "11", and then print "11".

So basically we want the script to filter out the number "11" in this case which we can use in Cacti for graphing. We've tried some scripts on google and looked around for information, but found nothing.

I think it should be easy if you know how to do it, but we are beginners at programming.

Thanks in advance!


Source: (StackOverflow)