# Retrieve device status - requestslibrary

**URL:** <https://forum.genieacs.com/t/retrieve-device-status-requestslibrary/3186>\
**Category:** Uncategorized\
**Created:** [November 11, 2022, 2:24pm UTC](https://forum.genieacs.com/t/retrieve-device-status-requestslibrary/3186 "2022-11-11T14:24:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![talksuresh](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@talksuresh](https://forum.genieacs.com/u/talksuresh)\
**Post date:** [November 11, 2022, 2:24pm UTC](https://forum.genieacs.com/t/retrieve-device-status-requestslibrary/3186/1 "2022-11-11T14:24:54Z")

</div>

I am using requestslibrary on genieacs server and get bunch of parameters. But i can’t find a field which tells us the status of the device. is there a way to check pinging status and device status using this library? I can see them from UI but need to retrieve them using a script

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [November 11, 2022, 6:53pm UTC](https://forum.genieacs.com/t/retrieve-device-status-requestslibrary/3186/2 "2022-11-11T18:53:17Z")

</div>

What data exactly are you trying to gather? Last inform time?

---

<div class="post-metadata">

**Author:** ![talksuresh](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@talksuresh](https://forum.genieacs.com/u/talksuresh)\
**Post date:** [November 13, 2022, 6:53pm UTC](https://forum.genieacs.com/t/retrieve-device-status-requestslibrary/3186/3 "2022-11-13T18:53:12Z")

</div>

i was looking for one parameter that can give exact status of device at the time of query like “registered” or “online” or “offline”.  
I was looking at previous discussions and it seems only option available for now is to check last inform time and periodic interval time and use the math to figure it out.  
Let me know if there is a simple and straight forward way.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [November 14, 2022, 6:21pm UTC](https://forum.genieacs.com/t/retrieve-device-status-requestslibrary/3186/4 "2022-11-14T18:21:30Z")

</div>

Math is the only way. GenieACS does not store the current connection state, nor should it. It knows when the CPE last connected.

When you do your math, give a 5 minute buffer between the different states. Example, I set my inform interval to 60 minutes. So when I’m displaying in the CPE state in our subscriber management platform, anything under 65 minutes is considered to be online. Anything from 65 minutes to 24 hours is indeterminate. And anything \> 24 hours is offline.

---

<div class="post-metadata">

**Author:** ![talksuresh](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@talksuresh](https://forum.genieacs.com/u/talksuresh)\
**Post date:** [November 14, 2022, 7:50pm UTC](https://forum.genieacs.com/t/retrieve-device-status-requestslibrary/3186/5 "2022-11-14T19:50:34Z")

</div>

Thank you. will go with that method.
