It’s been about an year since I’ve been hacking around with Cacti and SNMP on various platform here inside our Server Farm. I always had very interesting results with all the system I had to deal with whether they were FreeBSD/Linux boxes, Windows boxes, printers, routers or anything… except for the AIX boxes. AIX’s internal SNMP just sucks. Full stop. The information he’s able to report can be quantified with 2 fingers of one hand: installed software and TCP statistics. No way to report CPU usage, memory usage, file systems usage, or anything else.

So today I packed everything together and decided to compile net-snmp on AIX. I must admit I was pretty worried by this but it turned out to be pretty simple, if you just pay attention to a few steps.

First of all you need the AIX Linux Toolbox. It’s a bunch of RPMs to be installed to install the GCC compiler, the standard libs (LibGCC) and a few other things. Everything can be be found here: http://www-03.ibm.com/systems/p/os/aix/linux/toolbox/download.html

Basically you need just a few thing:

  • GCC / GCC++
  • LibGCC / LibGCC++ / LibGCC++-Devel
  • LSOF

Note that to compile net-snmp probably you don’t need all of them but I wanted to create a somewhat standard environment, so I decided to include all of them.

Optionally you may want (well, you HAVE to, unless you’re running AIX 5.3 or higher) to install GNU Grep and GNU SED as AIX default one have some problems with lines longer than 2048 chars.

After installing GNU Grep and GNU SED (you can find the RPMs at the usual Linux Toolbox page) you have to make sure that GNU grep and sed take the priority over standard one. There are several way to accomplish this. The one I choose was to edit /etc/environment and to change the standard PATH to include /opt/freeware/bin (that’s where grep and sed will be installed) before /usr/bin. So my PATH actually looked like this:

PATH=.:/opt/freeware/bin:/usr/bin:[whatever_else]

Now it was just a matter of un-tarring net-snmp’s sources somewhere and running configure. BUT! (there’s always a “but” with AIX) you have to pay attention to configure’s command line as the the default parameters seems not to work ok.

So what I came up (reading net-snmp’s docs) was this:

./configure –disable-shared –disable-embedded-perl –without-kmem-usage

this way you are disabling shared libs (which seems to cause segmentation faults) and embedded perl support (for the same reason). Last but not least you’re disabling KMEM because of compatibility issues with 64bit kernels. As of now net-snmp latest version is 5.4… if you’re using a newer version or you’re using a 32bit kernel you may want to test everything using kmem (although I don’t even know what it is).

Ok. After configure finishes (and it asks you a few standard question about snmp you should be able to answer by yourself) just run

make && make install

and you’ll be happy.

Do the standard configuration in /usr/local/share/snmp/snmpd.conf (read net-snmp docs on how to do that).

Now it’s time to stop AIX’s internal snmpd with

stopsrc -s snmpd

Check that it’s really stopped with a nice

ps -ef | grep snmpd

and then run

/usr/local/sbin/snmpd

Check it is running with the same

ps -ef | grep snmpd

as before and check it’s correctly reporting something by using snmpwalk from any other host (or from the same machine on localhost).

Now, there are some problems. At least I have them. net-snmp doesn’t report correctly for the all the TCP stuff (like lan cards activity and such). I really don’t know why but instead of getting crazy with that I just decided to reactivate AIX’s internal snmpd on a different port, for example 8161, (by editing /etc/services and specificing a different port for the snmp service instead of 161) and having net-snmp proxying that part of the snmp-tree to internal’s snmpd. Edit /usr/local/share/snmp/snmpd.conf and make sure you specify the listening port for net-snmp (just because we don’t want it to get confused by our previous changes in /etc/services) using the following line:

agentaddress udp:161

next step is to add the proxy specifications by using the proxy command. It should look something like this:

proxy -v 1 -c public 127.0.0.1:8161 .1.3.6.1.2.1.2.2.1

Basically you’re saying that whenever someone requests the .1.3.6.1.2.1.2.2.1 branch (that is the branch for the Ethernet Interfaces, net-snmp will proxy the request to the agent running on 127.0.0.1‘s port 8161, that is AIX’s internal snmpd, by using a version 1 snmp request.

Clever uh?

Restart /usr/local/sbin/snmpd and restart AIX’s snmpd with

startsrc -s snmpd

Let me know if it works for you :-)

May 272007
 

MilestonesOggi, domenica 27 maggio 2007, alle 19.42 circa mentre era sdraiato sul divano insieme a mamma e papà, sentendo “Vivere ancora” dall’album “Milestones” di Gino Paoli, Enrico Rava, Danilo Rea, Rosario Bonaccorso & Roberto Gatto, Dario ha pronunciato per la prima volta la parola “papà” (o qualcosa di veramente molto simile). Prima una volta, poi due… poi tre… poi altre due o tre.

Che bello. Che strano.

 

Caro negoziante,

volevo raccontarti perché oggi sia l’ultima volta in cui compererò qualcosa da te, in modo che, sebbene ora non te ne importi, sono certo, quando la tua attività sarà oramai un ricordo e ti troverai ad avere tantissimo tempo libero nella tua comoda casa, tu possa intrattenerti leggendo questa mia.
Il mondo del commercio è difficile, lo so, ma anche quello dell’acquirente lo è. Su questo, modestamente ritengo di essere un pelino più avanti degli altri, anche grazie al mio utilizzo di internet. Ed è propio per questo che quando devo comprare qualche cosa sono solito spendere numerose ore cercando tra specifiche e file pdf. Per questa ragione quando arrivo nel tuo negozio e incontro il cliente che ti chiede per ore se sia possibile attaccare il tostapane via usb, se valga veramente la pena comprare quel synth da 8000 euro o sia meglio quello da 12500 che però ha quel colore che non si abbina tanto con le sue scarpe (salvo poi prendere un cavo da 5 € netti), ho sempre un attimo di sussulto… Aspetto paziente e quando è il mio momento tiro fuori di tasca il foglio dove ho segnato marca modello e prezzo medio di ciò che mi serve, felice di poter finalmente sfoggiare la mia ricerca, le mie ore di studio. Tu mi guardi, ciondoli alcuni secondi per il negozio e mi proponi un altra cosa. Perché, mi chiedo io. E te lo chiedo pure. E tu inizi a dirmi che questo è meglio perché si, è comunque una scheda audio usb ma ha anche l’alzacristalli elettrico… E poi costa solo il triplo, vuoi mettere che affare? No, non mi servono gli alza cristalli elettrici, voglio solo questa cosa. E allora tu, non pago, incalzi con un altra cosa che costa solo il doppio. Io ormai sono stanco. Voglio andare a casa e mi serve una cazzo di scheda audio. Quando ti ripeto per la terza volta marca e modello mi guardi come se venissi da marte. Al che mi dico, ok, evidentemente non ha quello che cerco, e capitolo sulla scheda da 80 euro invece che quella da 46. Va bene, va bene, ora però valla a prendere, ti prego che il mondo gira ed io divento vecchio. E mentre tu ti allontani, mi avvicino alla vetrina e la vedo li, che mi guarda, con tanto di prezzo sopra – perfino più basso di quello che avessi trovato io: solo 40 euro -, esattamente lei, la scheda che da ore ti chiedo. Quando torni te lo faccio notare e tu che fai? Mica ti scusi… Mica mi dici “non ricordavo”… Mi rispondi “ma quella costa solo 40 euro… Vuoi mettere con la qualità di questa da 80?”… No. Non voglio mettere. Sono certo che quella da 80 suoni meglio, il problema è che voglio spendere 40 euro, non 80, e che ti ho detto io stesso prima che della qualità non me ne frega proprio un cazzo, voglio SOLO spendere poco. Ma oramai sono battuto psicologicamente. Mi prendo la scheda da 80, ma sappi che non mi vedrai mai più. Da oggi compro solo su internet con carta di credito. Compro come voglio, quello che voglio e me lo portano pure a casa. E di te non rimarrà che un ammasso di scontrini ed un negozio vuoto. Anzi, peggio, del tuo negozio non resterà nulla nel call center indiano che aprirà al suo posto.

E non dire che non te lo avevo detto.

 

La stanchezza si accumula, il sonno mi assale. Il piano della veglia e quello del riposo si mischiano in un unica poltiglia senza forma apparente. Non mi ricordo se ti ho visto o se ti ho sognato, e spesso ciò che vedo ho la sensazione di averlo già sognato. Frin-tok. Il meccanismo si incastra, frin-tok, il dente sgrana. Sono a questa fermata da una vita, spero che prima o poi passi il fotutto autobus che tutti aspettiamo con tanta ansia…

Il niente.

 

ho l’impressione che tu stia pigiando troppo forte sulla tastiera.

giuro.

si ho capito che state litigando ma a me la tastiera del pc serve anche domani….

e intanto, il tema del giorno, decisamente molto epico questa volta, è:

Joe Satriani – Top…
© 2011 extract the nectar, burn the tree Suffusion theme by Sayontan Sinha