LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-05-2018, 05:03 PM   #1
rwyarbrough
Member
 
Registered: Oct 2003
Location: Mesquite, Texas
Distribution: Slackware_x64 15.0 and slackware-current
Posts: 33

Rep: Reputation: 2
SNMPwalk on .1.3.6.1.2.1.25.6 hrSWInstalledTable produces "No Such Object available on this agent at this OID" error


I execute a snmpwalk on my ubuntu boxes from my main slackware server (14.2) and I can see the deb packages listed under OID .1.3.6.1.2.1.25.6. I execute a snmbwalk to any of my slackware boxes from my main slackware server and I receive the error: "hrSWInstalledTable produces No Such Object available on this agent at this OID"

I do see all the other HOST-RESOURCES-MIB items (.1.3.6.1.2.1.25.1 through .1.3.6.1.2.1.25.5 ) -- for example my running processes (hrSWRun) and devices and storage (hrDevice, hrStorage) so it seems the proper MIB is loaded but for some reason it doesn't know who to read the hrSWInstalledTable at .1.3.6.1.2.1.25.6


Any ideas how I can get the slackware installed packages list via snmp on slackware?

Thanks
 
Old 05-06-2018, 12:06 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
You'll have to write or find an extension which reads /var/log/packages and provides the information formatted correctly when those OIDs are requested by the agent.

EDIT: See https://vincent.bernat.im/en/blog/20...ending-netsnmp or http://net-snmp.sourceforge.net/wiki..._shell_scripts for ideas.

Last edited by Richard Cranium; 05-06-2018 at 12:26 PM.
 
1 members found this post helpful.
Old 05-07-2018, 10:45 AM   #3
rwyarbrough
Member
 
Registered: Oct 2003
Location: Mesquite, Texas
Distribution: Slackware_x64 15.0 and slackware-current
Posts: 33

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by Richard Cranium View Post
You'll have to write or find an extension which reads /var/log/packages and provides the information formatted correctly when those OIDs are requested by the agent.
Thank you sir. Since Ubuntu appears to already have an extension, I'll first take that avenue and see if I can find the Deb package version extension and modify it for Slackware as opposed to starting off from scratch. My search so far for a Slackware extension that has already been written to build the hrSWInstalledTable has been fruitless. Worst case, I'll take the information from the links provided and write one from scratch.

Also I'm beginning to wonder if it would be easier to just write a bash script to gather all the installed packages for all the systems outside of snmp and just import it into the NMS or use another tool all together even for that matter.

Assuming snmp would be easiest as it is gathering everything else already, but bash scripts would allow me to gather system health related information and configuration data separately.

I don't post here often and not sure of the rules here, aS far as marking this solved, should I go ahead and mark it solved as it requires custom code to resolve this, or should I wait until I actually either decide to scrap the idea in favor of pure bash scripting to get the information into a common place for all systems, or actually find/code a snmp extension that builds the Slackware hrSWInstalledTable?

Thanks,

Robert
 
Old 05-07-2018, 01:15 PM   #4
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Well, I would strongly suspect that any Debian package version extension will use calls to dpkg or some such to get that information. Slackware doesn't have much of an equivalent (it might, but I've always just looked in /var/log/packages), so I don't think such a thing will help all that much.

As for marking the thread SOLVED, if you think the problem you have has been solved (or as solved as it's going to get), then mark the thread so. If you think that you'll be back to ask further questions, then maybe let it be.
 
Old 07-15-2022, 09:40 AM   #5
Chasmo
LQ Newbie
 
Registered: Sep 2021
Posts: 4

Rep: Reputation: Disabled
Easy solution

* Sorry for the extra late reply, this is for the benefit of anyone still looking for an answer.
* As installed, net-snmp reports installed OS packages from /var/cache/hrmib (vs. Slackware /var/log/packages, /var/lib/pkgtools/packages).
* Method: clear out /var/cache/hrmib (disused by Slackware). Then, for each file in /var/log/packages, create a similarly-named empty file with timestamp matching the original.
* I use this script after each update of my Slackware 14, 15, and -current systems:

#!/bin/bash
cd /var/cache/hrmib || exit 1
find . -type f | xargs --no-run-if-empty rm
for i in /var/log/packages/* ; do
j=$(basename $i)
d=$(ls --full-time $i | awk '{print $6 " " $7 " " $8;}')
touch --date="$d" "$j"
done


* Now I get this result:

HOST-RESOURCES-MIB::hrSWInstalledIndex.1 = INTEGER: 1
HOST-RESOURCES-MIB::hrSWInstalledIndex.2 = INTEGER: 2
HOST-RESOURCES-MIB::hrSWInstalledIndex.3 = INTEGER: 3
HOST-RESOURCES-MIB::hrSWInstalledIndex.4 = INTEGER: 4
HOST-RESOURCES-MIB::hrSWInstalledIndex.5 = INTEGER: 5

<elided>

HOST-RESOURCES-MIB::hrSWInstalledName.1 = STRING: "lcms2-2.13-x86_64-2"
HOST-RESOURCES-MIB::hrSWInstalledName.2 = STRING: "xdg-utils-1.1.3-noarch-4"
HOST-RESOURCES-MIB::hrSWInstalledName.3 = STRING: "celt051-0.5.1.3-x86_64-1ponce"
HOST-RESOURCES-MIB::hrSWInstalledName.4 = STRING: "kpeople-5.90.0-x86_64-1"
HOST-RESOURCES-MIB::hrSWInstalledName.5 = STRING: "xman-1.1.5-x86_64-3"

<elided>

Q.E.D.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
glibc2.3.4 make, produces error "memcmp... file address 68" tgp1994 Linux - Software 5 11-28-2009 08:51 AM
unetbootin doesn't run, produces "bus error" message yoav_by Linux - Software 4 09-03-2009 03:43 PM
script using "/usr/bin/cat error" produces "cannot open" in cron Dcrusoe Programming 6 07-22-2009 03:30 PM
perl install error: Can't locate object method "new" via package "Module::Build::Vers powah Linux - Software 0 10-24-2006 01:57 PM
snmpwalk error: OID not increasing toships Linux - Wireless Networking 2 03-20-2004 12:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration