Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using the Pandora API

I kindly ask for some more info on how to get help / documentation on using the Pandora API.

Of course that I have already checked:

What I am interested in is " set planned_downtimes_created", I would like to know all the valid possibilities that I have available on the API for all the options, parameters, values, etc - all.

Also, I tried using the help, as mentioned exactly on the first page of the API documentation -> not clear, I was unable to retrieve any kind of info (I do not have an auth problem, the problem is "This operation does not exist.").

Would somebody please help me in clear this one out and maybe even make some push for updating the documentation with all the necessary information.

PS: i am using "Pandora FMS v6.0SP5 - Build PC170120"

Thank you very much,
Andrei Morarescu
Hi Andrei Morarescu,

Use this example:


Go to the configuration to modify the parameters of access. "Setup" -> "Setup" -> "General Setup"

[Image: 0JrNuJ9.png]

Here is set the IPs allowed and the password of the Api.
[Image: p6Jxc3v.png]

On the Pandora6.0SP6 version the problem not happens, you can update with .rpm files or with the Update manager online.
If you have any problem tell me.

Best regards,


Thank you, Vic, but this is not the problem.

The thing is that I want to dynamically set a downtime via API and I have been successful with this, just that I do not want to create recurrent downtime, I want them with the 'once' setting.

When I am using the keyword 'once' in the API call, it creates a new downtime entry but with some blank fields and doesn't actually seem valid.

I have even opened the PHP source code and at a first sight it did not seem to be implemented yet - could I get a confirmation / clarification from a developer, please ?

Also, I am able to do other stuff via API, so this is not an authentication / authorization problem.

Kind regards,
Andrei Morarescu
Hello again,

OK, so I did more digging through the source code and performed some more tests.

I got to a point, based on the findings from: functions_api.php, functions_planned_downtimes.php, planned_downtime.editor.php.

I have the following part of the API call: op=set&op2=planned_downtimes_created&id=LALA&other=testing|08/04/2018|08/05/2018|1|1|1|1|1|1|1|1|17:06:00|19:06:00|1|31|quiet|once|weekly

The awkward part is that I actually did more than one test with similar call (small changes around there) and it returns the ID of the new planned downtime created (so seems ok) but I am unable to see in the GUI the newly created downtime entries.

I am not sure if I have understood correctly the part from planned_downtime.editor.php - lines 240-280, but for me it seems that I simply need to put a '1' after the end_date and that would be a true for 'only alerts', but at the same time it doesn't seem that the variable is actually getting the value -> more likely to get a hardcode on '0'.

While writing this post I performed another test with:

The call returned again an ID and this time I am able to see it in the GUI, just that I see it with the following settings:
Name: LALA3
Group: all
Description: testing
Type: Disable agents
Execution: once
Set time - From 2018/08/04 - 00:00:00
To 2018/08/05 - 00:00:00

All seems fine, except two things:
a) i want the type to be disable_only_alerts
b) the hours are not correct (i did not set it at midnight)
and another side note: it doesn't allow me to have the end_date the same day as the start_date -> room for improvement

Any thoughts on the matter ?

To be honest, I am now considering in creating downtime by tapping directly on the DB as it seems that the API call simply makes some checks and afterwards an insert in the DB.

Thank you very much,
Andrei M.
Hi Andrei Morarescu,

When you create a planed downtimes, you need put "other_mode=url_encode_separator_|" for separate the fields and that the api takes the value of the fields in each variable.

Best regards,

(07-17-2017, 11:26 AM)vic Wrote: Hi Andrei Morarescu,

When you create a planed downtimes, you need put "other_mode=url_encode_separator_|" for separate the fields and that the api takes the value of the fields in each variable.

Best regards,


Hi Vic,

Yes, I used that in the link.. i just didn't copy in my post everything.. the same for the api token and password Smile

Thank you!
Did you get a solution on this
I'm running in to the same problem, in a Powershell script.
2 diverent ways and non of them is working in the script...
But both work in the browser.

Invoke-RestMethod -Uri "https://xxxxxxxxxx/pandora_console/include/api.php?op=set&op2=planned_downtimes_created&id=xxxxxxxxxxTest&other=xxxxxxxxxxTest%7C09%2F04%2F2019%7C09%2F05%2F2019%7C22%7C0%7C0%7C0%7C0%7C0%7C0%7C0%7C13:00:00%7C14:00:00%7C1%7C31%7Cdisable_agents_alerts%7Conce%7Cweekly%7CRoman&apipass=xxxxxxxxxx&user=xxxxxxxxxx&pass=xxxxxxxxxx&other_mode=url_encode_separator_|"

Invoke-RestMethod -Uri "https://xxxxxxxxxx/pandora_console/include/api.php?op=set&op2=planned_downtimes_created&id=xxxxxxxxxxTest&other=xxxxxxxxxxTest|09%2F04%2F2019|09%2F05%2F2019|22|0|0|0|0|0|0|0|13:00:00|14:00:00|1|31|disable_agents_alerts|once|weekly|Roman&apipass=xxxxxxxxxx&user=xxxxxxxxxx&pass=xxxxxxxxxx&other_mode=url_encode_separator_|"

any help is welcome

Users browsing this thread: 1 Guest(s)

(c) 2006-2018 Artica Soluciones Tecnológicas. Contents of this wiki are under Create Common Attribution v3 licence. | |

Theme © MyBB Themes