Page 1 of 1

When did my Linux last reboot

Posted: Wed Dec 20, 2023 9:47 am
by JohnFLi
My google-fu is not working well today.

I have the uptime on windows working well (thank you to people on the forum here) using the $USER1$/check_ncpa.py.

Now I'd like to do that for my Linux machines.

Nothing major or fancy....just want to know how long its been since the last time it booted.

Thank you

Re: When did my Linux last reboot

Posted: Wed Dec 20, 2023 10:42 am
by swolf
Hi @JohnFLi, thanks for reaching out.

Luckily for you this will be pretty similar on both Windows and Linux. It looks like Cody had you install NCPA on your Windows servers - you can use exactly the same agent on most distributions of Linux - see here for download links. From there, you should be able to configure the same command and get the same results.

Hopefully this helps - please let me know if you run into any further issues.

-Sebastian

Re: When did my Linux last reboot

Posted: Wed Dec 20, 2023 10:58 am
by JohnFLi
awesome, I did not even think about installing teh same client (linux version).
I will give it a try and report back

Re: When did my Linux last reboot

Posted: Wed Dec 20, 2023 4:46 pm
by JohnFLi
Ok, I am extra lame on Linux machines.

for testing, I installed the MCPA client on a test box.

Code: Select all

NAME="Rocky Linux"
VERSION="9.3 (Blue Onyx)"
different documentations all say the same thign for installing ncpa.....install seemed to go without issue

Code: Select all

 ModemManager.service               loaded active running Modem Manager
  ncpa.service                       loaded active running NCPA
  NetworkManager-wait-online.service loaded active exited  Network Manager Wait Online

Code: Select all

Nagios XI Dependencies                                                                                                                                            2.8 kB/s | 1.4 kB     00:00
Package ncpa-3.0.1-latest.x86_64 is already installed.
I try to add it in XI using the linux wizard can't get past the beginning

Code: Select all

Unable to contact server at https://servername:5693/testconnect/?token=mytoken
I made sure the ncpa.cfg file has the entry of: community_string = mytoken

Re: When did my Linux last reboot

Posted: Thu Dec 21, 2023 10:12 am
by gwesterman
Hi @JohnFli,

If you haven't, I would make sure that you correctly configured your firewall. The instructions to do so begin on page 16 of this document. Let us know if it still isn't working.

Thank you!

Re: When did my Linux last reboot

Posted: Thu Dec 21, 2023 1:28 pm
by JohnFLi
Yes, the firewall was it.

Thank you.

Now back to the regular testing with uptime. ;)

Re: When did my Linux last reboot

Posted: Fri Dec 22, 2023 10:04 am
by gwesterman
Glad I could help, and good luck with your testing!

Thank you!