Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not supported item when Service is on inactive state. #24

Open
rubenbperez opened this issue Apr 20, 2018 · 3 comments
Open

Not supported item when Service is on inactive state. #24

rubenbperez opened this issue Apr 20, 2018 · 3 comments

Comments

@rubenbperez
Copy link

Hi,
I have a little issue when a system is in inactive state, the module gives me back a ZBX_NOTSUPPORTED: Failed to lookup object path:

1707:20180420:150015.966 In update_cpustats()
1707:20180420:150015.966 End of update_cpustats()
1707:20180420:150015.967 __zbx_zbx_setproctitle() title:'collector [idle 1 sec]'
1707:20180420:150016.967 __zbx_zbx_setproctitle() title:'collector [processing data]'
1707:20180420:150016.967 In update_cpustats()
1707:20180420:150016.967 End of update_cpustats()
1707:20180420:150016.967 __zbx_zbx_setproctitle() title:'collector [idle 1 sec]'
1708:20180420:150016.968 __zbx_zbx_setproctitle() title:'listener #1 [processing request]'
1708:20180420:150016.968 Requested [systemd.service.info[elasticsearchcurator,state]]
1708:20180420:150016.968 [systemd] org.freedesktop.systemd1.NoSuchUnit: Unit elasticsearchcurator.service not loaded.
1708:20180420:150016.968 Sending back [ZBX_NOTSUPPORTED: Failed to lookup object path]
1708:20180420:150016.968 __zbx_zbx_setproctitle() title:'listener #1 [waiting for connection]'
1707:20180420:150017.967 __zbx_zbx_setproctitle() title:'collector [processing data]'
1707:20180420:150017.967 In update_cpustats()
1707:20180420:150017.967 End of update_cpustats()
1707:20180420:150017.967 __zbx_zbx_setproctitle() title:'collector [idle 1 sec]'
1707:20180420:150018.967 __zbx_zbx_setproctitle() title:'collector [processing data]'
1707:20180420:150018.968 In update_cpustats()
1707:20180420:150018.968 End of update_cpustats()
1707:20180420:150018.968 __zbx_zbx_setproctitle() title:'collector [idle 1 sec]'
1707:20180420:150019.968 __zbx_zbx_setproctitle() title:'collector [processing data]'
1707:20180420:150019.968 In update_cpustats()
1707:20180420:150019.968 End of update_cpustats()
1707:20180420:150019.968 __zbx_zbx_setproctitle() title:'collector [idle 1 sec]'
1707:20180420:150020.968 __zbx_zbx_setproctitle() title:'collector [processing data]'
1707:20180420:150020.968 In update_cpustats()
1707:20180420:150020.968 End of update_cpustats()

Any idea?

Thank you.

@cavaliercoder
Copy link
Collaborator

It might be related to this issue: systemd/systemd#3807. In this case, an inactive service is actually unloaded.

From the output above, it appears the systemd API is claiming there is no elasticsearchcurator.service service unit. The module is simply reporting this.

What result do you see for $ systemctl status elasticsearchcurator.service when the service is inactive?

@rubenbperez
Copy link
Author

rubenbperez commented Apr 20, 2018

Thanks for you fast answer.

This also happens to system services in Ubuntu 16.04.

$ systemctl show elasticsearchcurator.service | grep State
LoadState=loaded
ActiveState=inactive
SubState=dead
UnitFileState=disabled
StateChangeTimestampMonotonic=0
$ systemctl status elasticsearchcurator.service 
● elasticsearchcurator.service - ElasticSearchCurator. Cure it all.
   Loaded: loaded (/etc/systemd/system/elasticsearchcurator.service; disabled; vendor preset: enabled)
   Active: inactive (dead)

@rubenbperez
Copy link
Author

rubenbperez commented Apr 22, 2018

Finally I used this solution: systemd/systemd#1929

Doc: https://dbus.freedesktop.org/doc/api/html/group__DBusPendingCall.html#ga5a738928c2369fef093ce00658903d06

I hope for non side-effects for the change (I didn't read full code).

EDIT:

There's a little problem. With the above change, it always gives back an object path which means every string is a service (this makes systemd_unit_is_service function to always return true).
To Solve this problem I made a double check: When ActiveState is checked I also check for LoadState which may give me the existance of the service. After checking this, I created a new Code (255) to show No Such Service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants