1
18.1 Legacy Series / Simple service status check from shell?
« on: April 24, 2018, 05:48:45 am »
Trying to integrate some simple service status checks for a nagios server. I found a guide for configuring these for pfsense, but it revolves around the commandline utility pfSsh.php, which OPNsense apparently does not have.
I found the request for an alternative tool on GitHub (https://github.com/opnsense/core/issues/412), and i discovered 'configctl', but these don't cut it. When I try to do 'configctl openssh status', it tells me "Action not found", and indeed it is not found under /usr/local/opnsense/service/conf/actions.d.
But why not? What is so hard about having a simple 'service openssh status' command to check its status? How is the GUI checking the status of openssh behind the scenes, and how can I run that behind the scenes myself?
In the example here (https://forum.opnsense.org/index.php?topic=2085.0), apparently you can run 'configctl proxy status' and are supposed to get the status info, but for me it just says "Cannot 'status' squid. Set squid_enable to YES in /etc/rc.conf or use 'onestatus' instead of 'status'". There is no /etc/rd.conf file, but there is a /etc/rc.conf.d/squid/squid file that has squid_enable="NO", however.
So is the only way to do this to create an /etc/rc.conf.d/openssh.conf file with "enabled=YES" in it? This doesn't make sense, since openssh is already running at boot, so why does the commandline say it's not running?
Why is this so complicated??
I found the request for an alternative tool on GitHub (https://github.com/opnsense/core/issues/412), and i discovered 'configctl', but these don't cut it. When I try to do 'configctl openssh status', it tells me "Action not found", and indeed it is not found under /usr/local/opnsense/service/conf/actions.d.
But why not? What is so hard about having a simple 'service openssh status' command to check its status? How is the GUI checking the status of openssh behind the scenes, and how can I run that behind the scenes myself?
In the example here (https://forum.opnsense.org/index.php?topic=2085.0), apparently you can run 'configctl proxy status' and are supposed to get the status info, but for me it just says "Cannot 'status' squid. Set squid_enable to YES in /etc/rc.conf or use 'onestatus' instead of 'status'". There is no /etc/rd.conf file, but there is a /etc/rc.conf.d/squid/squid file that has squid_enable="NO", however.
So is the only way to do this to create an /etc/rc.conf.d/openssh.conf file with "enabled=YES" in it? This doesn't make sense, since openssh is already running at boot, so why does the commandline say it's not running?
Why is this so complicated??