# Problem snmpd on cacti server



## arsyam (Oct 1, 2018)

Hello master,

I have a case, initially cacti and snmpd running well.

Then I want to install the nano editor with the command: 

```
# pkg install nano

But the Pkg is also upgraded.

root@mrtg:~ # pkg install nano
Updating repository catalogue
digests.txz                                                                               100% 2733KB  48.8KB/s  62.7KB/s   00:56
packagesite.txz                                                                           100% 6600KB 101.5KB/s 240.5KB/s   01:05
Incremental update completed, 32534 packages processed:
0 packages updated, 0 removed and 32534 added.
New version of pkg detected; it needs to be installed first.
The following 1 packages will be installed:

        Upgrading pkg: 1.2.7_3 -> 1.10.5_3

The installation will require 3 MB more space

3 MB to be downloaded

Proceed with installing packages [y/N]: y
pkg-1.10.5_3.txz                                                                          100% 2607KB  89.9KB/s  67.3KB/s   00:29
Checking integrity... done
[1/1] Upgrading pkg from 1.2.7_3 to 1.10.5_3... done
/lib/libc.so.7: version FBSD_1.4 required by /usr/local/lib/libpkg.so.4 not found
```
And after i check, snmpd error while i'm restart :

```
root@mrtg:~ # service snmpd start
Starting snmpd.
Shared object "libpkg.so.1" not found, required by "snmpd"
/usr/local/etc/rc.d/snmpd: WARNING: failed to start snmpd
```
Then, i symlink libpkg.so.1 on direktory /usr/local/lib, new errors appears :

```
root@mrtg:~ # service snmpd restart
snmpd not running? (check /var/run/net_snmpd.pid).
Starting snmpd.
/usr/local/lib/libpkg.so.1: version LIBPKG_1.2 required by /usr/local/lib/libnetsnmpmibs.so.30 not found
/usr/local/etc/rc.d/snmpd: WARNING: failed to start snmpd
```
Anyone can help ? 
please urgent (((((


Best Regards,
Arsyam


----------



## SirDice (Oct 1, 2018)

arsyam said:


> /lib/libc.so.7: version FBSD_1.4 required by /usr/local/lib/libpkg.so.4 not found


What version of FreeBSD?

Keep your system updated. It looks like you haven't updated in about 5 years. You really need to be more vigilant in this regard. 



arsyam said:


> Then, I symlink libpkg.so.1 on direktory /usr/local/lib


Never, ever, do this. It's never the correct solution.


----------



## arsyam (Oct 1, 2018)

Dear SirDice,

This my FreeBSD version :

```
root@mrtg:~ # freebsd-version
10.0-RELEASE
```
So what should I do? I am newbie 

Best Regards,
Arsyam


----------



## SirDice (Oct 1, 2018)

FreeBSD 10.0 has been End-of-Life since February 2015 and is not supported any more. You will need to upgrade to a _supported_ version first.

https://www.freebsd.org/security/unsupported.html


----------



## arsyam (Oct 1, 2018)

Dear SirDice,

Can I return or undo pkg 1.10.5_3 to 1.2.7_3?

because cacti is needed in my place of work. 

Best Regards,
Arsyam


----------



## SirDice (Oct 1, 2018)

The old package may still be lingering in /var/cache/pkg. But I would put some effort into correctly updating the machine. Besides being End of Life you're also missing about 5 years worth of security updates making the machine a serious liability on your network,


----------



## arsyam (Oct 1, 2018)

Dear SirDice,

If i want to updating this machine, please give me step by step so that cacti and snmpd running well.

Please help me sir 


Best Regards,


----------



## SirDice (Oct 1, 2018)

Handbook: 23.2.3. Performing Major and Minor Version Upgrades

FreeBSD 10.4-RELEASE Release Notes


----------



## arsyam (Oct 1, 2018)

Dear SirDice,

If I update FreeBSD, will it affect cacti and snmpd (data cacti/ rra) ? 

Best Regards,


----------



## SirDice (Oct 1, 2018)

It shouldn't. But it's always a good idea to have a backup of course, just in case.


----------



## arsyam (Oct 1, 2018)

Dear SirDice,

If now the version I use is 10.0, then what version should I update to freeBSD?

Best Regards,
Arsyam


----------



## SirDice (Oct 1, 2018)

In your case I'd go with 10.4 for now. Once that's done you should plan an upgrade to 11.x.


----------



## arsyam (Oct 2, 2018)

Dear SirDice,

I have run the following command:

# freebsd-update -r 10.4-RELEASE upgrade

And  the result is like this (attached)

So what should i do ? 

Run this command : 
*# nextboot -k GENERIC*

Or run this command :
# *shutdown -r now*

# *freebsd-update install*
???

Please help me Sir.


Best Regards,
Arsyam


----------



## arsyam (Oct 2, 2018)

Dear SirDice,


I have updated, but when I check the freebsd-version is still 10.0-RELEASE. 

Why?


Best Regards,


----------



## SirDice (Oct 2, 2018)

Installation is done with `freebsd-update install`. A `freebsd-update ..... upgrade` only _downloads_ the updates.


----------



## arsyam (Oct 2, 2018)

SirDice said:


> Installation is done with `freebsd-update install`. A `freebsd-update ..... upgrade` only _downloads_ the updates.



Dear Sir SirDice 

I have a problem.

My FreeBSD Version is 10.0-RELEASE, and i upgrade use this command :

# *freebsd-update -r 10.4-RELEASE upgrade*

*# shutdown -r now *

*#freebsd-update install*

And this is output :

*segmentation fault (core dumped)
segmentation fault (core dumped)
segmentation fault (core dumped)*

I can't stop that output and then im restart the VM.

and i get the error (attached).

I was run this command :

enter full pathname of shell or return for /bin/sh : */rescue/sh
# fsck -y
# mount -a
# mount -a -t ufs
# fsck /*

but still cannot booting 

Please help me Sir  


Best Regards,


----------



## SirDice (Oct 2, 2018)

I'm wondering why you're getting an "exec format" error. I've only seen that happen when I messed up with 32 vs 64 bit. But a freebsd-update(8) always downloads the correct one so this shouldn't happen.

For now try to put back your old kernel:

```
cp -R /boot/kernel.old /boot/kernel
```
And boot that. Then post the whole output from `uname -a`.


----------



## arsyam (Oct 4, 2018)

SirDice said:


> I'm wondering why you're getting an "exec format" error. I've only seen that happen when I messed up with 32 vs 64 bit. But a freebsd-update(8) always downloads the correct one so this shouldn't happen.
> 
> For now try to put back your old kernel:
> 
> ...



Dear Mr. SirDice 

I'am sorry late reply.

Thanks for your answer.

I have done what you suggested.

Attached is the result of the command I have done (attached).

Please help.


Best Regards,


----------



## arsyam (Oct 5, 2018)

SirDice said:


> I'm wondering why you're getting an "exec format" error. I've only seen that happen when I messed up with 32 vs 64 bit. But a freebsd-update(8) always downloads the correct one so this shouldn't happen.
> 
> For now try to put back your old kernel:
> 
> ...



Dear Sir SirDice ,

Please help me Sir.


Best Regards,


----------



## SirDice (Oct 5, 2018)

Just copying the kernel doesn't make it active. So you'll need to reboot, that will boot your old kernel again.


----------



## arsyam (Oct 7, 2018)

SirDice said:


> Just copying the kernel doesn't make it active. So you'll need to reboot, that will boot your old kernel again.



Dear SirDice 

Yes, I have copied the kernel, and rebooted.
But it's still an error.

Please help me solve this problem. 



Best Regards,


----------



## SirDice (Oct 8, 2018)

arsyam said:


> Yes, I have copied the kernel, and rebooted.


And you didn't notice the read-only errors? You actually didn't copy anything.


----------



## arsyam (Oct 8, 2018)

SirDice said:


> And you didn't notice the read-only errors? You actually didn't copy anything.



Dear SirDice ,

Yes, 
I see a read-only error, but after I run the *mount -a* command, I can copy /boot/kernel.old to /boot/kernel.

*# mv /boot/kernel /boot/kernel-backup
# cp -R /boot/kernel.old /boot/kernel
*
Regards,


----------

