Page 1 of 1
manage_services.sh missing snmptrapd
Posted: Mon Aug 26, 2019 11:01 am
by maglaubig
Is there a reason that snmptrapd is missing as a type of service check for the service being online? I tried and added it to the "second" argument validation array on line 23 at the end of the line:
Code: Select all
second=("postgresql" "httpd" "mysqld" "nagios" "ndo2db" "npcd" "snmptt" "ntpd" "crond" "shellinaboxd" "snmptrapd" )
It works as a valid service check, but I'm not sure why snmptrapd is missing when snmptt is included or if there is another way I should be checking for this service as being running.
Re: manage_services.sh missing snmptrapd
Posted: Mon Aug 26, 2019 2:21 pm
by lmiltchev
The "snmptrapd" didn't used to be added by default in older versions of Nagios XI, that's why it's still missing from the script. In addition to this, we don't restart snmptrapd anywhere from the interface, so there is no need for it to be added at this time.
Why would you use this script to check the status of this service anyway? You could use:
or
Code: Select all
systemctl status snmptrapd.service
depending on the OS you are running...
Re: manage_services.sh missing snmptrapd
Posted: Tue Aug 27, 2019 9:21 am
by maglaubig
I was following some best practices from a Nagios KB:
https://support.nagios.com/kb/article/n ... 5-420.html
The KB is a few years old, so I'm not 100% sure if all of the recommendations still hold as true as they did when it was published. I copied some of the default service checks on localhost and was changing the service name, snmptt worked and snmptrapd didn't so I went looking for why, found the script file I mentioned, and then just tried that as an edit to add snmptrapd. This seemed to be a path of least resistance versus what the KB had outlined. This appears to have used NCPA like modules, but I haven't fully looked at it since I found this other way.
It makes sense to me that since snmptrapd is being distributed as default enabled that there be some method to check the service. I'm not quite sure how to check for a service dependency in CentOS (I deployed using the NagiosXI OVA). If snmptt is truly dependent on snmptrapd as in it will shut down if snmptrapd dies for some reason, I'm OK with just checking snmptt and calling it a day.
Based on that is this worth an enhancement request?
Re: manage_services.sh missing snmptrapd
Posted: Tue Aug 27, 2019 9:53 am
by lmiltchev
The
Best Practices document that is linked into the KB article doesn't say anything about using the manage_services.sh script... It points out that you could use the
check_init_service plugin, which is a part of our
Linux Agent installer.
example01.PNG
Based on that is this worth an enhancement request?
Are you talking about adding the "snmptrapd" to manage_services.sh script?
Code: Select all
second=("postgresql" "httpd" "mysqld" "nagios" "ndo2db" "npcd" "snmptt" "ntpd" "crond" "shellinaboxd" "snmptrapd")
We don't need a feature request in order to do this. It's simple enough. I will talk to our developers and ask them to add snmptrapd to the script.
Re: manage_services.sh missing snmptrapd
Posted: Tue Aug 27, 2019 10:50 am
by maglaubig
You're 100% correct that best practices didn't mention using this script, I did that on my own, apologies for not making that more clear. I thought adding the Linux agent when we had a script capable of checking what I was after made more sense to me.
I hadn't made it all the way through the best practices guide before my initial posting, there are many other checks recommended, some of which at least look they have made their way in to XI mainstream as their own checks no longer requiring the plugins Troy created. That check for the root mailbox on MRTG config errors, I'm glad to have come across it now, but dang I have more work to do!
Yes please about including snmptrapd in the manage_services.sh script, that's what I would have submitted in an enhancement request. For the time being I'll edit manually if I upgrade until it's in the next release. I'm expecting the upgrade will clobber any changes I make to that file.
Re: manage_services.sh missing snmptrapd
Posted: Tue Aug 27, 2019 11:50 am
by lmiltchev
Yes please about including snmptrapd in the manage_services.sh script, that's what I would have submitted in an enhancement request. For the time being I'll edit manually if I upgrade until it's in the next release. I'm expecting the upgrade will clobber any changes I make to that file.
Actually, the "snmptrapd" has been already added to the script according to our developers, so it should be present in the next version of Nagios XI.
Re: manage_services.sh missing snmptrapd
Posted: Tue Aug 27, 2019 2:00 pm
by maglaubig
Cool, thanks for checking. I say we're good to lock the post.