Hello Team,
As we are getting total alert information from the Nagios Core Dashboard, Can we get that total number of alerts from the Mariadb query.
We want that data in our application portal to show how many alerts generated every WEEK/MONTH/DAY.
For doing this we need mariadb Query to generate weekly monthly total alert like it is showing in the attachment.
Can you please check and let me know the Query.
Regards,
Manoj Namdev
MariadDB Query for Total alert generated from last WEEK/MONT
Re: MariadDB Query for Total alert generated from last WEEK/
I'm a bit confused. Nagios Core doesn't have a MariaDB back-end. Unless you're referring to NagiosQL? Or Nagios XI?
If you wanted to do this programatically, I think the JSON Query Generator is probably the best route.We want that data in our application portal to show how many alerts generated every WEEK/MONTH/DAY.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: MariadDB Query for Total alert generated from last WEEK/
@mcapra is correct, this data isn't in a DB in Core by default
Re: MariadDB Query for Total alert generated from last WEEK/
Thanks team,
Its great help you guys are genius.
Can you just tell me how i can run JSON Query means fields to get desired output.
I want to count weekly hard alerts from the nagios core server.. I am little bit confused in date format and some other fields.
Please help me.
Thanks for your prompt support also
Its great help you guys are genius.
Can you just tell me how i can run JSON Query means fields to get desired output.
I want to count weekly hard alerts from the nagios core server.. I am little bit confused in date format and some other fields.
Please help me.
Thanks for your prompt support also
Re: MariadDB Query for Total alert generated from last WEEK/
Specifically confused with Date Format and how i can keep "start time" and "end time"
Re: MariadDB Query for Total alert generated from last WEEK/
prasadt wrote: I want to count
Your "Start Time" and "End Time" will need to be evaluated as unix epochs at the time you make the JSON Query request.prasadt wrote:weekly
Which creates this request:prasadt wrote:hard alerts
Code: Select all
http://10.35.6.50/nagios/cgi-bin/archivejson.cgi?query=alertcount&statetypes=hard&starttime=1493657796&endtime=1497459396
Code: Select all
{
"format_version": 0,
"result": {
"query_time": 1497459542000,
"cgi": "archivejson.cgi",
"user": "nagiosadmin",
"query": "alertcount",
"query_status": "released",
"program_start": 1497368308000,
"last_data_update": 1497459181000,
"type_code": 0,
"type_text": "Success",
"message": ""
},
"data": {
"selectors": {
"starttime": 1493657796000,
"endtime": 1497459396000,
"statetypes": 1
},
"count": 155
}
}
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: MariadDB Query for Total alert generated from last WEEK/
Thanks Mcapra,
Perfect Thanks a lot you saved my life.
I Got what i was looking and i tried from every wrong place but in only 1 days you guys have cracked this even i can say in just some minutes.
Thanks a lot for simplify this and given me in such a perfect query.
Have a nice DAY
You can please close this ticket.
Regards,
Manoj Namdev
Perfect Thanks a lot you saved my life.
I Got what i was looking and i tried from every wrong place but in only 1 days you guys have cracked this even i can say in just some minutes.
Thanks a lot for simplify this and given me in such a perfect query.
Have a nice DAY
You can please close this ticket.
Regards,
Manoj Namdev