PHP simple functions to get performance data from Nagios database

完了済み 投稿 Mar 23, 2014 着払い
完了済み 着払い

Given a nagios database (I can provide one sql file with all the tables and data for testing purposes), I would like to have coded two similar functions creating queries that use the NDOUtils DB model ([url removed, login to view])

1) function report_nagios_services ($array_of_service_IDs, $date, $type)

It returns 5 arrays (or 1 array of 5 arrays) that shows how long each monitor has been ok, warning, unknown, undetermined or critical.

$type can have 3 values: day, month or year using $date as reference: day means apply the function to the nagios data of the date $date, month means apply the function to the nagios data of the 30 last days before $date (including $date) and year means 365 days before $date (including $date)

For instance report_nagios_services(array(1,2,3),$date,"day")

returns

$result_ok = [100,52,27]

$result_warning = [0,48,0]

$result_unknown = [0,0,0]

$result_undetermined = [0,0,0]

$result_critical = [0,0,73]

which means that service_id 1 has been OK all the time so far today, service_id 2 has been ok 52% of the time and in warning 48%, and service_id 3 has been ok 27% of the time and critical 73% of the time. For each service_id, the5 values should always sum the same value.

Please note that I will need a different array for each state, or an array of arrays as $result['ok'], $result['warning'], etc.

2) function report_nagios_hosts ($array_of_host_IDs, $date, $type) similar to the previous but for a list of hosts instead of for a list of services

I will have more complex nagios queries after these first two. This project is just a proof of concepts of the skills of the coder.

Linux MySQL PHP SQL

プロジェクトID: #5707327

プロジェクトについて

2個の提案 リモートプロジェクト アクティブ Mar 24, 2014

アワード:

shihan033010

Hi I can do the both function within 1 day. Please accept the bid. I am ready to start it. Please let me inform if you have any question to me.

$30 USD 1日以内
(237レビュー)
6.3

2人のフリーランサーが、平均$30 で、この仕事に入札しています。

mudassarmalik

Hi, I am Mudassar Malik, i have Masters Degree in Computer Science and i have more than one year Software development experience as a software engineer in a software company. During my professional car もっと

$30 USD 2日以内
(0件のレビュー)
0.0