[HOWTO] Install and configure the Net-SNMP agent for Unix

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Moderators, Developers

Author
Message
User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#46 Post by fmangeant » Fri Jul 13, 2007 4:24 am

Sorry for reading your post too late :cry:

I'm not using 5.4 everywhere, for example extending the agent does not work any more for me on AIX 64 bits...
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

7063
Posts: 5
Joined: Mon Jul 09, 2007 10:56 am

#47 Post by 7063 » Fri Jul 13, 2007 12:16 pm

fmangeant wrote:Sorry for reading your post too late :cry:

I'm not using 5.4 everywhere, for example extending the agent does not work any more for me on AIX 64 bits...
Don't worry, I managed the issue on my own. Have a nice week end.

neji
Posts: 3
Joined: Wed Aug 01, 2007 4:51 pm

Help!!

#48 Post by neji » Wed Aug 01, 2007 5:20 pm

Hi, I instaled Cacti in Fedora 6, and i can add a host, but i cant get de diskinfo from the host. I trie with:

snmpwalk -v 1 -c public tcp:localhost:161 .1.3.6.1.4.1.2021.9.1.2

but got this:

End of MIB

I tried wiht this too:

snmptranslate .1.3.6.1.4.1.2021.9.1.2
UCD-SNMP-MIB::dskPath
snmpwalk -v 1 -c public tcp:localhost:161 UCD-SNMP-MIB::dskPath

and i got the same

This is my /etc/snmp/snmp.conf

agentaddress tcp:161
com2sec notConfigUser default public
rocommunity public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view all included .iso 80
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup "" any noauth exact systemview none none
syslocation Bat. C2
syscontact [email protected]
includeAllDisks 10%


Any help?, thanks

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Re: Help!!

#49 Post by fmangeant » Thu Aug 02, 2007 1:55 am

neji wrote:This is my /etc/snmp/snmp.conf

includeAllDisks 10%
Hi

most of the time (at least on my servers) the includeAllDisks option does not work. Could you replace it with something like this :

Code: Select all

disk /
disk /usr
disk /var
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

neji
Posts: 3
Joined: Wed Aug 01, 2007 4:51 pm

Help!!

#50 Post by neji » Thu Aug 02, 2007 10:46 am

Hi

I replaced includeAllDisk with this:

Code: Select all

disk /
and restart the snmp service: "service snmpd restart", and i got this:

Code: Select all

$ snmpwalk -v 1 -c public tcp:localhost:161 dskPath
End of MIB
$ snmpget -v 1 -c public tcp:localhost:161 dskPath
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::dskPath
Any idea?, thanks

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#51 Post by fmangeant » Fri Aug 03, 2007 1:48 am

Can you try with only that in snmpd.conf ?

Code: Select all

agentaddress tcp:161
rocommunity public
disk /
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

neji
Posts: 3
Joined: Wed Aug 01, 2007 4:51 pm

#52 Post by neji » Fri Aug 03, 2007 11:08 am

fmangeant wrote:Can you try with only that in snmpd.conf ?

Code: Select all

agentaddress tcp:161
rocommunity public
disk /
Thanks!
I tried with that snmpd.conf and that's works. Now i can get that info and add that host in my cacti-host, and view the graphics. Thanks!

Antistar
Posts: 2
Joined: Tue Oct 09, 2007 4:04 am

man

#53 Post by Antistar » Tue Oct 09, 2007 6:43 am

i just simply love you. thank you very much

Smux
Posts: 40
Joined: Mon Sep 10, 2007 2:47 pm

#54 Post by Smux » Tue Dec 04, 2007 12:48 pm

My net-snmp agent dont work when i click in Verbose Query to get informations to my processors. I just click and before 5 minutes my webserver returns error 500: internal error server, in my server, show a loop process to /usr/bin/php -q
/home/xxx/www/cacti/scripts/ss_host_cpu.php ... shows it:

Code: Select all

[[email protected] ~]# /usr/bin/php -q /home/sigfbr/public_html/cacti/scripts/ss_host_disk.php xxx.xxx.xxx.xxx 6 2:161:500:public:::MD5::DES: index
No log handling enabled - turning on stderr logging
Cannot find module (MTA-MIB): At line 0 in (none)
Cannot find module (NETWORK-SERVICES-MIB): At line 0 in (none)
Cannot find module (LM-SENSORS-MIB): At line 0 in (none)
In my other server with net-snmp 5.3.1 this not happen...

Can anyone compile a version 5.4 to linux centos (fedore core 6) and attach here to me??
Last edited by Smux on Tue Dec 04, 2007 2:11 pm, edited 1 time in total.

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#55 Post by fmangeant » Tue Dec 04, 2007 1:45 pm

Can you :
  • update Net-SNMP to version 5.3.1-15 (available here) on your Fedora Core 6 box ?
  • unset the MIBS variable on your Cacti server ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

Smux
Posts: 40
Joined: Mon Sep 10, 2007 2:47 pm

#56 Post by Smux » Tue Dec 04, 2007 1:57 pm

hey fmangeant,

Thank you very much!! But when i click in Verbose Query my error persists... My cacti is 0.8.7a with svn revision at 4371.
Last edited by Smux on Tue Dec 04, 2007 2:08 pm, edited 1 time in total.

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#57 Post by fmangeant » Tue Dec 04, 2007 2:07 pm

Try that :

Code: Select all

$ unset MIBS
$ /usr/bin/php -q /home/sigfbr/public_html/cacti/scripts/ss_host_disk.php xx.xx.xx.xx 6 2:161:500:public:::MD5::DES: index
By the way, maybe you should remove your IP address from your previous post.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

Smux
Posts: 40
Joined: Mon Sep 10, 2007 2:47 pm

#58 Post by Smux » Tue Dec 04, 2007 2:13 pm

Ip address removed:

Code: Select all

[[email protected] snmp]# /usr/bin/php -q /home/sigfbr/public_html/cacti/scripts/ss_host_disk.php xx.xx.xx.xx 6 2:161:500:public:::MD5::DES: index
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15


[[email protected] snmp]# /usr/bin/php -q /home/sigfbr/public_html/cacti/scripts/ss_host_cpu.php xx.xx.xx.xx 6 2:161:500:public:::MD5::DES: index

how to i solve my problem?

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#59 Post by fmangeant » Tue Dec 04, 2007 2:15 pm

Smux wrote:My cacti is 0.8.7a with svn revision at 4371.
Could you revert to 0.8.7a ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

Smux
Posts: 40
Joined: Mon Sep 10, 2007 2:47 pm

#60 Post by Smux » Tue Dec 04, 2007 2:43 pm

I have same problem with 0.8.7a.

This is my 0.8.7a with revision 4371:

Code: Select all

[[email protected] snmp]# /usr/bin/php -q /home/sigfbr/public_html/cacti/scripts/ss_host_cpu.php localhost 2 2:161:500:public:::MD5::DES: index

[[email protected] snmp]#
and my 0.8.7a:

Code: Select all

[[email protected] snmp]# /usr/bin/php -q /home/sigfbr/public_html/cacti2/scripts/ss_host_cpu.php localhost 2 2:161:500:public:::MD5::DES: index
[[email protected] snmp]#
if I check my other server with old cacti (0.8.7):

Code: Select all

[email protected] [/home/admin]# /usr/bin/php -q /home/sysmon/public_html/cacti/scripts/ss_host_cpu.php localhost 2 2:161:500:public:::MD5::DES: index
0
1
2
3
[email protected] [/home/admin]#
my snmpd.conf is the same for all my servers

Code: Select all

[[email protected] snmp]# cat snmpd.conf

rocommunity public
syslocation ForBrazil - SvrXX
syscontact [email protected]
# dontPrintUnits true
includeAllDisks 10%


createUser xxxx MD5 xxxxxxx DES
group groupv3             usm      admfbrsnmp
view    all included   .iso      80
access groupv3         ""        any       auth      exact    systemview         all        all

Post Reply