如何确定linux进程记帐(accton)当前是否正在运行?

时间:2022-06-21 07:20:24

Is there any way to determine whether process accounting (accton) is running? There is no process listed in the process table ("ps"), and I see nothing under "/etc" that I can call with "status" to get a status of accounting.

有没有办法确定进程记帐(accton)是否正在运行?流程表(“ps”)中没有列出任何流程,我在“/ etc”下看不到任何可以通过“status”调用以获取会计状态的流程。

I'm running a custom build based on "Linux From Scratch", so while I understand that CentOS has "psacct", I don't have that available.

我正在运行基于“Linux From Scratch”的自定义构建,所以虽然我知道CentOS有“psacct”,但我没有那个。

I could watch the log file and see if it's growing - not ideal, but if it's all I got, then it's all I got. I'm hoping there's a better way.

我可以看日志文件,看看它是否在增长 - 不理想,但如果它是我得到的,那就是我得到的全部。我希望有更好的方法。

Appreciate any info.

感谢任何信息。

1 个解决方案

#1


1  

May be you can do like this. enable logging for your accton, an check the log file for update. like time stamp modification/lat access time/modify time ?

也许你可以这样做。为您的accton启用日志记录,检查日志文件以进行更新。喜欢时间戳修改/ lat访问时间/修改时间?

/sbin/accton /var/log/accto.log then the log will be created.

/ sbin / accton /var/log/accto.log然后将创建日志。

Then use some script to monitor your accto.log. There are lot of log file monitoring scripts for nagios if you are interested.

然后使用一些脚本来监控您的accto.log。如果您有兴趣,可以使用很多日志文件监视脚本。

#1


1  

May be you can do like this. enable logging for your accton, an check the log file for update. like time stamp modification/lat access time/modify time ?

也许你可以这样做。为您的accton启用日志记录,检查日志文件以进行更新。喜欢时间戳修改/ lat访问时间/修改时间?

/sbin/accton /var/log/accto.log then the log will be created.

/ sbin / accton /var/log/accto.log然后将创建日志。

Then use some script to monitor your accto.log. There are lot of log file monitoring scripts for nagios if you are interested.

然后使用一些脚本来监控您的accto.log。如果您有兴趣,可以使用很多日志文件监视脚本。