本發(fā)明實(shí)施例涉及計(jì)算機(jī)
技術(shù)領(lǐng)域:
,尤其涉及一種監(jiān)控方法及其裝置。
背景技術(shù):
:目前,市面上的監(jiān)控軟件大多需要專業(yè)人員手工進(jìn)行監(jiān)控配置,并根據(jù)不同的服務(wù)器應(yīng)用手工配置相應(yīng)的監(jiān)控項(xiàng),因此,無(wú)法實(shí)現(xiàn)自動(dòng)化配置,從而降低了監(jiān)控配置的效率。技術(shù)實(shí)現(xiàn)要素:本發(fā)明實(shí)施例提供一種監(jiān)控方法及其裝置,用以提升監(jiān)控配置的效率。本發(fā)明實(shí)施例提供一種監(jiān)控方法,包括:根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,獲取監(jiān)控客戶端的監(jiān)控項(xiàng);根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,監(jiān)控策略庫(kù)中的信息項(xiàng)至少包括:監(jiān)控項(xiàng)、監(jiān)控策略;將與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端,以使監(jiān)控客戶端根據(jù)監(jiān)控策略對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控。較佳的,監(jiān)控策略庫(kù)的信息項(xiàng)還包括:監(jiān)控客戶端的標(biāo)識(shí);在監(jiān)控策略庫(kù)中的監(jiān)控策略發(fā)生更新時(shí),確定更新的監(jiān)控策略所對(duì)應(yīng)的監(jiān)控客戶端,并將更新后的監(jiān)控策略發(fā)送給對(duì)應(yīng)的監(jiān)控客戶端。較佳的,根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,包括:根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),判斷監(jiān)控策略庫(kù)中是否存在與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,若存在,則從監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,否則,則將監(jiān)控客戶端的監(jiān)控項(xiàng)保存在配置信息中,以便于在更新后的監(jiān)控策略庫(kù)中存在與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略時(shí),將對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端。較佳的,配置信息中還包括監(jiān)控客戶端的類型,且監(jiān)控策略庫(kù)中還包括:監(jiān)控客戶端的類型;根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,獲取監(jiān)控客戶端的監(jiān)控項(xiàng),包括:根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,獲取監(jiān)控客戶端的類型和監(jiān)控客戶端的監(jiān)控項(xiàng);根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,包括:根據(jù)監(jiān)控客戶端的類型和監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定對(duì)應(yīng)的監(jiān)控策略。較佳的,在將與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端之后,還包括:接收監(jiān)控客戶端發(fā)送的告警信息,告警信息是監(jiān)控客戶端在對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控的過(guò)程中存在異常時(shí)所生成的。本發(fā)明實(shí)施例提供一種監(jiān)控裝置,包括:獲取模塊,用于根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,獲取監(jiān)控客戶端的監(jiān)控項(xiàng);確定模塊,用于根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,監(jiān)控策略庫(kù)中的信息項(xiàng)至少包括:監(jiān)控項(xiàng)、監(jiān)控策略;發(fā)送模塊,用于將與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端,以使監(jiān)控客戶端根據(jù)監(jiān)控策略對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控。較佳的,監(jiān)控策略庫(kù)的信息項(xiàng)還包括:監(jiān)控客戶端的標(biāo)識(shí);在監(jiān)控策略庫(kù)中的監(jiān)控策略發(fā)生更新時(shí),確定更新的監(jiān)控策略所對(duì)應(yīng)的監(jiān)控客戶端,并將更新后的監(jiān)控策略發(fā)送給對(duì)應(yīng)的監(jiān)控客戶端。較佳的,確定模塊,具體用于:根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),判斷監(jiān)控策略庫(kù)中是否存在與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,若存在,則從監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,否則,則將監(jiān)控客戶端的監(jiān)控項(xiàng)保存在配置信息中,以便于在更新后的監(jiān)控策略庫(kù)中存在與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略時(shí),將對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端。較佳的,配置信息中還包括監(jiān)控客戶端的類型,且監(jiān)控策略庫(kù)中還包括:監(jiān)控客戶端的類型;獲取模塊,具體用于:根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,獲取監(jiān)控客戶端的類型和監(jiān)控客戶端的監(jiān)控項(xiàng);確定模塊,具體用于:根據(jù)監(jiān)控客戶端的類型和監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定對(duì)應(yīng)的監(jiān)控策略。較佳的,獲取模塊,還用于:在將與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端之后,接收監(jiān)控客戶端發(fā)送的告警信息,告警信息是監(jiān)控客戶端在對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控的過(guò)程中存在異常時(shí)所生成的。上述實(shí)施例提供的監(jiān)控方法及其裝置,包括:根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,獲取監(jiān)控客戶端的監(jiān)控項(xiàng);根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,監(jiān)控策略庫(kù)中的信息項(xiàng)至少包括:監(jiān)控項(xiàng)、監(jiān)控策略;將與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端,以使監(jiān)控客戶端根據(jù)監(jiān)控策略對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控??梢钥闯觯讷@取到監(jiān)控客戶端的監(jiān)控項(xiàng)以后,可根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),自動(dòng)的從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,并自動(dòng)的將監(jiān)控策略發(fā)送給監(jiān)控客戶端,以使監(jiān)控客戶端自動(dòng)的根據(jù)監(jiān)控策略對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控,在整個(gè)過(guò)程中,并不需要人工參與,從而能夠減少人力成本、提升監(jiān)控配置的效率。此外,對(duì)監(jiān)控策略的維護(hù)還能夠統(tǒng)一進(jìn)行維護(hù),從而提升運(yùn)維水平。附圖說(shuō)明為了更清楚地說(shuō)明本發(fā)明實(shí)施例中的技術(shù)方案,下面將對(duì)實(shí)施例描述中所需要使用的附圖作簡(jiǎn)要介紹。圖1為本發(fā)明實(shí)施例提供的一種網(wǎng)絡(luò)架構(gòu)示意圖;圖2為本發(fā)明實(shí)施例提供的一種監(jiān)控方法流程示意圖;圖3為本發(fā)明實(shí)施例提供的從監(jiān)控策略庫(kù)中確定于監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略的方法流程示意圖;圖4為本發(fā)明實(shí)施例提供的一種監(jiān)控裝置的結(jié)構(gòu)示意圖。具體實(shí)施方式為了使本發(fā)明的目的、技術(shù)方案及有益效果更加清楚明白,以下結(jié)合附圖及實(shí)施例,對(duì)本發(fā)明進(jìn)行進(jìn)一步詳細(xì)說(shuō)明。應(yīng)當(dāng)理解,此處所描述的具體實(shí)施例僅僅用以解釋本發(fā)明,并不用于限定本發(fā)明。圖1示例性示出了本發(fā)明實(shí)施例適用的一種網(wǎng)絡(luò)架構(gòu)示意圖,如圖1所示,本發(fā)明實(shí)施例適用的網(wǎng)絡(luò)架構(gòu)可包括:監(jiān)控服務(wù)端101、監(jiān)控客戶端102a~102n。其中,監(jiān)控服務(wù)端101與監(jiān)控客戶端102a~102n之間通過(guò)網(wǎng)絡(luò)進(jìn)行信息交互,監(jiān)控服務(wù)端101中還設(shè)置有監(jiān)控策略庫(kù),監(jiān)控策略庫(kù)中存儲(chǔ)有用戶對(duì)監(jiān)控客戶端的監(jiān)控項(xiàng)進(jìn)行監(jiān)控的監(jiān)控策略,監(jiān)控策略庫(kù)中的信息項(xiàng)至少包括:監(jiān)控項(xiàng)、監(jiān)控策略;監(jiān)控服務(wù)端101通過(guò)訪問(wèn)監(jiān)控策略庫(kù)以獲取對(duì)應(yīng)的監(jiān)控策略,并通過(guò)網(wǎng)絡(luò)將監(jiān)控策略發(fā)送給監(jiān)控客戶端,以使監(jiān)控客戶端根據(jù)接收到的監(jiān)控策略對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控。需要說(shuō)明的是,在一些應(yīng)用場(chǎng)景中,監(jiān)控客戶端102a~102n可以是各種類型的終端,而在另一些應(yīng)用場(chǎng)景中,監(jiān)控客戶端102a~102n也可以是各種類型的服務(wù)器,例如,監(jiān)控客戶端102a~102n可以是云平臺(tái)虛擬機(jī)、數(shù)據(jù)庫(kù)服務(wù)器、中間件服務(wù)器等。因此,本發(fā)明實(shí)施例對(duì)監(jiān)控客戶端102a~102n的類型不做任何限定,即任何類型的監(jiān)控客戶端102a~102n均能夠應(yīng)用于本發(fā)明實(shí)施例中。需要注意的是,本發(fā)明實(shí)施例中的監(jiān)控策略可以是指本發(fā)明實(shí)施例新制定的監(jiān)控配置策略,也可以是現(xiàn)有技術(shù)中的任意監(jiān)控策略,只要在監(jiān)控客戶端接收到監(jiān)控服務(wù)端的監(jiān)控策略以后,能夠?qū)崿F(xiàn)自動(dòng)配置及監(jiān)控即可。此外,為了描述簡(jiǎn)便起見(jiàn),本發(fā)明實(shí)施例中的監(jiān)控策略庫(kù)均是采用表格的形式所表示的,本發(fā)明實(shí)施例中采用表格表示監(jiān)控策略庫(kù)僅是示例性的,即本發(fā)明實(shí)施例中的監(jiān)控策略庫(kù)并不限于采用表格,還可以采用其它的存儲(chǔ)形式存儲(chǔ)監(jiān)控策略庫(kù),例如,也可采用數(shù)據(jù)庫(kù)存儲(chǔ)監(jiān)控策略庫(kù)。圖2示例性示出了本發(fā)明實(shí)施例提供的一種監(jiān)控方法流程示意圖,如圖2所示,該方法可包括:s201、根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,獲取監(jiān)控客戶端的監(jiān)控項(xiàng)。s202、根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,其中,監(jiān)控策略庫(kù)中的信息項(xiàng)至少包括:監(jiān)控項(xiàng)、監(jiān)控策略。s203、將與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端,以使監(jiān)控客戶端根據(jù)監(jiān)控策略對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控。在上述步驟s201中,根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,獲取監(jiān)控客戶端的監(jiān)控項(xiàng)時(shí),監(jiān)控客戶端的配置信息可包括但不限于監(jiān)控客戶端的主機(jī)信息和監(jiān)控客戶端的ip地址信息。具體的,當(dāng)監(jiān)控客戶端上線、修改、下線時(shí),均會(huì)自動(dòng)更新配置信息,并將更新后的配置信息發(fā)送給監(jiān)控服務(wù)端,從而監(jiān)控服務(wù)端能夠檢測(cè)到監(jiān)控客戶端的配置信息,并可根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,獲取監(jiān)控客戶端的監(jiān)控項(xiàng)。例如,監(jiān)控服務(wù)端檢測(cè)到的監(jiān)控客戶端的配置信息可包括:監(jiān)控客戶端的主機(jī)信息和監(jiān)控客戶端的ip地址信息,其格式可參見(jiàn)下列表格一。表格一在監(jiān)控服務(wù)端根據(jù)配置信息,獲取監(jiān)控客戶端的地址信息以后,可根據(jù)監(jiān)控客戶端的地址信息,從而獲取監(jiān)控客戶端的監(jiān)控項(xiàng)。在上述步驟s202中,在根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定于監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略時(shí),可采用圖3所示的方法流程。s301、獲取監(jiān)控客戶端的監(jiān)控項(xiàng)。s302、根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),判斷預(yù)先設(shè)置的監(jiān)控策略庫(kù)中是否存在與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,若存在,則轉(zhuǎn)至步驟s303,否則,轉(zhuǎn)至步驟s304。s303、從監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略。s304、將監(jiān)控客戶端的監(jiān)控項(xiàng)保存在配置信息中,以便于在更新后的監(jiān)控策略庫(kù)中存在于監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略時(shí),將對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端。可選的,為了保障監(jiān)控部署的效率,監(jiān)控策略庫(kù)的信息項(xiàng)還可包括:監(jiān)控客戶端的標(biāo)識(shí),從而在監(jiān)控策略庫(kù)中的監(jiān)控策略發(fā)生更新時(shí),確定更新后的監(jiān)控策略所對(duì)應(yīng)的監(jiān)控客戶端,并將更新后的監(jiān)控策略發(fā)送給對(duì)應(yīng)的監(jiān)控客戶端。例如,監(jiān)控策略庫(kù)中存儲(chǔ)的各監(jiān)控客戶端、各監(jiān)控客戶端的監(jiān)控項(xiàng)以及各監(jiān)控客戶端的監(jiān)控策略,如下列表格二所示。表格二監(jiān)控客戶端標(biāo)識(shí)監(jiān)控項(xiàng)監(jiān)控策略監(jiān)控客戶端bredis監(jiān)控策略101監(jiān)控客戶端credis監(jiān)控策略101監(jiān)控客戶端dsina監(jiān)控策略102當(dāng)將監(jiān)控項(xiàng)“redis”對(duì)應(yīng)的監(jiān)控策略“監(jiān)控策略101”更新為“監(jiān)控策略105”時(shí),此時(shí),監(jiān)控策略庫(kù)中存儲(chǔ)的各監(jiān)控客戶端、各監(jiān)控客戶端的監(jiān)控項(xiàng)以及各監(jiān)控客戶端的監(jiān)控策略,可如下列表格三所示。表格三監(jiān)控客戶端標(biāo)識(shí)監(jiān)控項(xiàng)監(jiān)控策略監(jiān)控客戶端bredis監(jiān)控策略105監(jiān)控客戶端credis監(jiān)控策略105監(jiān)控客戶端dsina監(jiān)控策略102從上述表格三可以看出,更新后的監(jiān)控策略“監(jiān)控策略105”所對(duì)應(yīng)的監(jiān)控客戶端為“監(jiān)控客戶端b”和“監(jiān)控客戶端c”,由于,更新后的監(jiān)控策略“監(jiān)控策略105”對(duì)應(yīng)的監(jiān)控客戶端為“監(jiān)控客戶端b”和“監(jiān)控客戶端c”,因此,為了保障監(jiān)控的效率,只需要將“監(jiān)控策略105”發(fā)送給“監(jiān)控客戶端b”和“監(jiān)控客戶端c”即可。可選的,針對(duì)同一監(jiān)控項(xiàng),在監(jiān)控客戶端的類型不同時(shí),為了能夠采用不同的監(jiān)控策略,監(jiān)控客戶端的配置信息中還可包括:監(jiān)控客戶端的類型,并且監(jiān)控策略庫(kù)中還可包括:監(jiān)控客戶端的類型。具體的,當(dāng)監(jiān)控客戶端的配置信息中包括監(jiān)控客戶端的類型時(shí),根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,可獲取到監(jiān)控客戶端的類型和監(jiān)控客戶端的監(jiān)控項(xiàng),然后根據(jù)監(jiān)控客戶端的類型和監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定對(duì)應(yīng)的監(jiān)控策略。例如,監(jiān)控服務(wù)端中預(yù)先存儲(chǔ)的監(jiān)控策略庫(kù),可如下列表格四所示。表格四監(jiān)控客戶端類型監(jiān)控項(xiàng)監(jiān)控策略1mysql監(jiān)控策略2012mysql監(jiān)控策略2021oracle監(jiān)控策略3012oracle監(jiān)控策略302基于表格四所提供的監(jiān)控策略庫(kù)的基礎(chǔ)上,當(dāng)監(jiān)控服務(wù)端檢測(cè)到監(jiān)控客戶端e的配置信息,根據(jù)配置信息獲取到監(jiān)控客戶端e的類型為“1”且監(jiān)控客戶端e的監(jiān)控項(xiàng)為“mysql”和“oracle”,由于監(jiān)控服務(wù)端檢測(cè)到監(jiān)控客戶端e的類型為“1”且監(jiān)控客戶端e的監(jiān)控項(xiàng)為“mysql”和“oracle”,因此,監(jiān)控服務(wù)端可將“監(jiān)控策略201”和“監(jiān)控策略301”發(fā)送給監(jiān)控客戶端e。進(jìn)一步假設(shè),當(dāng)監(jiān)控服務(wù)端檢測(cè)到監(jiān)控客戶端f的配置信息,根據(jù)配置信息獲取到監(jiān)控客戶端f的類型為“2”且監(jiān)控客戶端f的監(jiān)控項(xiàng)為“mysql”和“oracle”,由于監(jiān)控服務(wù)端檢測(cè)到監(jiān)控客戶端f的類型為“2”且監(jiān)控客戶端f的監(jiān)控項(xiàng)為“mysql”和“oracle”,因此,監(jiān)控服務(wù)端可將“監(jiān)控策略202”和“監(jiān)控策略302”發(fā)送給監(jiān)控客戶端e。需要說(shuō)明的是,在實(shí)際應(yīng)用中,監(jiān)控客戶端的類型可以是多種,為了描述簡(jiǎn)便起見(jiàn),在本發(fā)明實(shí)施例中僅描述了兩種類型的監(jiān)控客戶端。為了提升監(jiān)控的效率,在將與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端之后,還可接收監(jiān)控客戶端發(fā)送的告警信息,該告警信息是監(jiān)控客戶端在對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控的過(guò)程中存在異常時(shí)所生成的。具體的,告警信息可包括但不限于:監(jiān)控客戶端與監(jiān)控服務(wù)端連通性告警、同步機(jī)制同步失敗告警、監(jiān)控采樣異常告警。其中,監(jiān)控客戶端與監(jiān)控服務(wù)端連通性告警可以指在監(jiān)控客戶端與監(jiān)控服務(wù)端未連通時(shí),發(fā)送告警信息;同步機(jī)制同步失敗告警可以指在監(jiān)控策略發(fā)生更新時(shí),在將更新后的策略發(fā)送給相應(yīng)的監(jiān)控客戶端時(shí),未同步成功,則發(fā)送告警信息;監(jiān)控采樣異常告警可以指在監(jiān)控部署完成后,監(jiān)控客戶端實(shí)施監(jiān)控采樣點(diǎn)分析,當(dāng)發(fā)現(xiàn)監(jiān)控采樣點(diǎn)與預(yù)期不一致時(shí),發(fā)送告警信息。其中,監(jiān)控客戶端在將告警信息發(fā)送給監(jiān)控服務(wù)端時(shí),可通過(guò)指定的方式將告警信息發(fā)送該給監(jiān)控服務(wù)端,監(jiān)控服務(wù)端會(huì)將統(tǒng)一將這些告警信息進(jìn)行展現(xiàn),并及時(shí)通知到相關(guān)運(yùn)維人員進(jìn)行異常處理,從而能夠提升監(jiān)控效率。下面通過(guò)一個(gè)具體的例子,對(duì)上述的方法流程進(jìn)行詳細(xì)的解釋說(shuō)明。假設(shè)監(jiān)控服務(wù)端中預(yù)先設(shè)置的監(jiān)控策略庫(kù),可參見(jiàn)下列表格五。表格五監(jiān)控客戶端類型監(jiān)控項(xiàng)監(jiān)控策略1mysql監(jiān)控策略12mysql監(jiān)控策略21oracle監(jiān)控策略32oracle監(jiān)控策略41qq監(jiān)控策略52qq監(jiān)控策略6從上述表格五可以看出,當(dāng)監(jiān)控客戶端的類型為“1”,且監(jiān)控項(xiàng)為“mysql”時(shí),對(duì)應(yīng)的監(jiān)控策略為“監(jiān)控策略1”;當(dāng)監(jiān)控客戶端的類型為“2”,且監(jiān)控項(xiàng)為“mysql”時(shí),對(duì)應(yīng)的監(jiān)控策略為“監(jiān)控策略2”;當(dāng)監(jiān)控客戶端的類型為“1”,且監(jiān)控項(xiàng)為“oracle”時(shí),對(duì)應(yīng)的監(jiān)控策略為“監(jiān)控策略3”;當(dāng)監(jiān)控客戶端的類型為“2”,且監(jiān)控項(xiàng)為“oracle”時(shí),對(duì)應(yīng)的監(jiān)控策略為“監(jiān)控策略4”;當(dāng)監(jiān)控客戶端的類型為“1”,且監(jiān)控項(xiàng)為“qq”時(shí),對(duì)應(yīng)的監(jiān)控策略為“監(jiān)控策略5”;當(dāng)監(jiān)控客戶端的類型為“2”,且監(jiān)控項(xiàng)為“qq”時(shí),對(duì)應(yīng)的監(jiān)控策略為“監(jiān)控策略6”?;谏鲜霰砀裎逅峁┑谋O(jiān)控策略庫(kù)的基礎(chǔ)上,當(dāng)監(jiān)控服務(wù)端根據(jù)配置信息檢測(cè)到監(jiān)控客戶端m上線時(shí),假設(shè)新增的監(jiān)控客戶端m的ip地址為192.168.1.0,則可根據(jù)監(jiān)控客戶端m的ip地址“192.168.1.0”向監(jiān)控客戶端m發(fā)送一個(gè)以“發(fā)現(xiàn)模塊”命名的功能程序,以獲取監(jiān)控客戶端m上安裝的應(yīng)用,同時(shí),將監(jiān)控客戶端m的ip地址“192.168.1.0”保存至服務(wù)端的配置文件中。進(jìn)一步假設(shè),通過(guò)“發(fā)現(xiàn)模塊”獲得監(jiān)控客戶端m上安裝的應(yīng)用為:mysql、oracle、qq、taobao,并且通過(guò)“發(fā)現(xiàn)模塊”獲得監(jiān)控客戶端m的類型為“1”,因此,可將在監(jiān)控客戶端類型為“1”時(shí),mysql對(duì)應(yīng)的“監(jiān)控策略1”、oracle對(duì)應(yīng)的“監(jiān)控策略3”、qq對(duì)應(yīng)的“監(jiān)控策略5”發(fā)送給監(jiān)控客戶端m,由于“taobao”在監(jiān)控策略庫(kù)中不存在對(duì)應(yīng)的監(jiān)控策略,因此,即使獲取到監(jiān)控客戶端m上安裝有應(yīng)用“taobao”也不對(duì)“taobao”進(jìn)行監(jiān)控。在獲取到監(jiān)控客戶端m的標(biāo)識(shí)信息“監(jiān)控客戶端m”以后,也可將監(jiān)控客戶端m的標(biāo)識(shí)信息添加至監(jiān)控策略庫(kù)中。在將監(jiān)控客戶端m的標(biāo)識(shí)信息添加至監(jiān)控策略庫(kù)以后,可參見(jiàn)下列表格六。表格六基于上述表格六所提供的監(jiān)控策略庫(kù)的基礎(chǔ)上,當(dāng)監(jiān)控服務(wù)端根據(jù)配置信息檢測(cè)到監(jiān)控客戶端n上線時(shí),假設(shè)新增的監(jiān)控客戶端n的ip地址為192.168.2.0,則可根據(jù)監(jiān)控客戶端n的ip地址向監(jiān)控客戶端n發(fā)送一個(gè)以“發(fā)現(xiàn)模塊”命名的功能程序,以獲取監(jiān)控客戶端n上安裝的應(yīng)用,同時(shí),將監(jiān)控客戶端n的ip地址“192.168.2.0”保存至服務(wù)端的配置文件中。進(jìn)一步假設(shè),通過(guò)“發(fā)現(xiàn)模塊”獲得監(jiān)控客戶端n上安裝的應(yīng)用為:mysql、oracle、qq、taobao,并且通過(guò)“發(fā)現(xiàn)模塊”獲得監(jiān)控客戶端m的類型為“2”,因此,可將在監(jiān)控客戶端類型為“2”時(shí),mysql對(duì)應(yīng)的“監(jiān)控策略2”、oracle對(duì)應(yīng)的“監(jiān)控策略4”、qq對(duì)應(yīng)的“監(jiān)控策略6”發(fā)送給監(jiān)控客戶端n,由于“taobao”在監(jiān)控策略庫(kù)中不存在對(duì)應(yīng)的監(jiān)控策略,因此,即使獲取到監(jiān)控客戶端n上安裝有應(yīng)用“taobao”也不對(duì)“taobao”進(jìn)行監(jiān)控。在獲取到監(jiān)控客戶端n的標(biāo)識(shí)信息“監(jiān)控客戶端n”以后,也可將監(jiān)控客戶端n的標(biāo)識(shí)信息添加至監(jiān)控策略庫(kù)中。在將監(jiān)控客戶端m的標(biāo)識(shí)信息添加至監(jiān)控策略庫(kù)以后,可參見(jiàn)下列表格七。表格七監(jiān)控客戶端標(biāo)識(shí)監(jiān)控客戶端的類型監(jiān)控項(xiàng)監(jiān)控策略監(jiān)控客戶端m1mysql監(jiān)控策略1監(jiān)控客戶端n2mysql監(jiān)控策略2監(jiān)控客戶端m1oracle監(jiān)控策略3監(jiān)控客戶端n2oracle監(jiān)控策略4監(jiān)控客戶端m1qq監(jiān)控策略5監(jiān)控客戶端n2qq監(jiān)控策略6基于上述表格七所提供的監(jiān)控策略庫(kù)的基礎(chǔ)上,進(jìn)一步假設(shè),對(duì)表格七中的“監(jiān)控策略1”和“監(jiān)控策略2”進(jìn)行了更新,并且假設(shè)“監(jiān)控策略1”更新后的監(jiān)控策略為“監(jiān)控策略10”,“監(jiān)控策略2”更新后的監(jiān)控策略為“監(jiān)控策略20”,則更新后的監(jiān)控策略庫(kù),可如下列表格八所示。表格八監(jiān)控客戶端標(biāo)識(shí)監(jiān)控客戶端的類型監(jiān)控項(xiàng)監(jiān)控策略監(jiān)控客戶端m1mysql監(jiān)控策略10監(jiān)控客戶端n2mysql監(jiān)控策略20監(jiān)控客戶端m1oracle監(jiān)控策略3監(jiān)控客戶端n2oracle監(jiān)控策略4監(jiān)控客戶端m1qq監(jiān)控策略5監(jiān)控客戶端n2qq監(jiān)控策略6從上述表格八可以看出,更新后的監(jiān)控策略10對(duì)應(yīng)的監(jiān)控客戶端為m,并且在服務(wù)端的配置文件保存了監(jiān)控客戶端m的ip地址為“192.168.1.0”,因此,可根據(jù)監(jiān)控客戶端m的ip地址“192.168.1.0”,將更新后的監(jiān)控策略“監(jiān)控策略10”發(fā)送給監(jiān)控客戶端m。同理,更新后的監(jiān)控策略20對(duì)應(yīng)的監(jiān)控客戶端為n,并且在服務(wù)端的配置文件保存了監(jiān)控客戶端n的ip地址為“192.168.2.0”,因此,可根據(jù)監(jiān)控客戶端n的ip地址“192.168.2.0”,將更新后的監(jiān)控策略“監(jiān)控策略20”發(fā)送給監(jiān)控客戶端n。根據(jù)以上內(nèi)容可以看出,在獲取到監(jiān)控客戶端的監(jiān)控項(xiàng)以后,可根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),自動(dòng)的從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,并自動(dòng)的將監(jiān)控策略發(fā)送給監(jiān)控客戶端,以使監(jiān)控客戶端自動(dòng)的根據(jù)監(jiān)控策略對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控,在整個(gè)過(guò)程中,并不需要人工參與,從而能夠減少人力成本、提升監(jiān)控配置的效率。同時(shí),還可以避免因?yàn)槿藶橐蛩厮鶎?dǎo)致的遺漏一些監(jiān)控項(xiàng)的現(xiàn)象發(fā)生。此外,對(duì)監(jiān)控策略的維護(hù)還能夠統(tǒng)一進(jìn)行維護(hù),將監(jiān)控做到更加全面、更加自動(dòng)化,從而提升運(yùn)維水平。基于相同的技術(shù)構(gòu)思,本發(fā)明實(shí)施例還提供一種監(jiān)控裝置,如圖4所示,該裝置可包括:獲取模塊401,用于根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,獲取監(jiān)控客戶端的監(jiān)控項(xiàng);確定模塊402,用于根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,監(jiān)控策略庫(kù)中的信息項(xiàng)至少包括:監(jiān)控項(xiàng)、監(jiān)控策略;發(fā)送模塊403,用于將與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端,以使監(jiān)控客戶端根據(jù)監(jiān)控策略對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控。較佳的,監(jiān)控策略庫(kù)的信息項(xiàng)還包括:監(jiān)控客戶端的標(biāo)識(shí);在監(jiān)控策略庫(kù)中的監(jiān)控策略發(fā)生更新時(shí),確定更新的監(jiān)控策略所對(duì)應(yīng)的監(jiān)控客戶端,并將更新后的監(jiān)控策略發(fā)送給對(duì)應(yīng)的監(jiān)控客戶端。較佳的,確定模塊402,具體用于:根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),判斷監(jiān)控策略庫(kù)中是否存在與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,若存在,則從監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,否則,則將監(jiān)控客戶端的監(jiān)控項(xiàng)保存在配置信息中,以便于在更新后的監(jiān)控策略庫(kù)中存在與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略時(shí),將對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端。較佳的,配置信息中還包括監(jiān)控客戶端的類型,且監(jiān)控策略庫(kù)中還包括:監(jiān)控客戶端的類型;獲取模塊401,具體用于:根據(jù)檢測(cè)到的監(jiān)控客戶端的配置信息,獲取監(jiān)控客戶端的類型和監(jiān)控客戶端的監(jiān)控項(xiàng);確定模塊402,具體用于:根據(jù)監(jiān)控客戶端的類型和監(jiān)控客戶端的監(jiān)控項(xiàng),從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定對(duì)應(yīng)的監(jiān)控策略。較佳的,獲取模塊401,還用于:在將與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略發(fā)送給監(jiān)控客戶端之后,接收監(jiān)控客戶端發(fā)送的告警信息,告警信息是監(jiān)控客戶端在對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控的過(guò)程中存在異常時(shí)所生成的。綜上,可以看出,在獲取到監(jiān)控客戶端的監(jiān)控項(xiàng)以后,可根據(jù)監(jiān)控客戶端的監(jiān)控項(xiàng),自動(dòng)的從預(yù)先設(shè)置的監(jiān)控策略庫(kù)中確定與監(jiān)控項(xiàng)對(duì)應(yīng)的監(jiān)控策略,并自動(dòng)的將監(jiān)控策略發(fā)送給監(jiān)控客戶端,以使監(jiān)控客戶端自動(dòng)的根據(jù)監(jiān)控策略對(duì)監(jiān)控項(xiàng)進(jìn)行監(jiān)控,在整個(gè)過(guò)程中,并不需要人工參與,從而能夠減少人力成本、提升監(jiān)控配置的效率。同時(shí),還可以避免因?yàn)槿藶橐蛩厮鶎?dǎo)致的遺漏一些監(jiān)控項(xiàng)的現(xiàn)象發(fā)生。此外,對(duì)監(jiān)控策略的維護(hù)還能夠統(tǒng)一進(jìn)行維護(hù),將監(jiān)控做到更加全面、更加自動(dòng)化,從而提升運(yùn)維水平。本領(lǐng)域內(nèi)的技術(shù)人員應(yīng)明白,本發(fā)明的實(shí)施例可提供為方法、或計(jì)算機(jī)程序產(chǎn)品。因此,本發(fā)明可采用完全硬件實(shí)施例、完全軟件實(shí)施例、或結(jié)合軟件和硬件方面的實(shí)施例的形式。而且,本發(fā)明可采用在一個(gè)或多個(gè)其中包含有計(jì)算機(jī)可用程序代碼的計(jì)算機(jī)可用存儲(chǔ)介質(zhì)(包括但不限于磁盤存儲(chǔ)器、cd-rom、光學(xué)存儲(chǔ)器等)上實(shí)施的計(jì)算機(jī)程序產(chǎn)品的形式。本發(fā)明是參照根據(jù)本發(fā)明實(shí)施例的方法、設(shè)備(系統(tǒng))、和計(jì)算機(jī)程序產(chǎn)品的流程圖和/或方框圖來(lái)描述的。應(yīng)理解可由計(jì)算機(jī)程序指令實(shí)現(xiàn)流程圖和/或方框圖中的每一流程和/或方框、以及流程圖和/或方框圖中的流程和/或方框的結(jié)合??商峁┻@些計(jì)算機(jī)程序指令到通用計(jì)算機(jī)、專用計(jì)算機(jī)、嵌入式處理機(jī)或其他可編程數(shù)據(jù)處理設(shè)備的處理器以產(chǎn)生一個(gè)機(jī)器,使得通過(guò)計(jì)算機(jī)或其他可編程數(shù)據(jù)處理設(shè)備的處理器執(zhí)行的指令產(chǎn)生用于實(shí)現(xiàn)在流程圖一個(gè)流程或多個(gè)流程和/或方框圖一個(gè)方框或多個(gè)方框中指定的功能的裝置。這些計(jì)算機(jī)程序指令也可存儲(chǔ)在能引導(dǎo)計(jì)算機(jī)或其他可編程數(shù)據(jù)處理設(shè)備以特定方式工作的計(jì)算機(jī)可讀存儲(chǔ)器中,使得存儲(chǔ)在該計(jì)算機(jī)可讀存儲(chǔ)器中的指令產(chǎn)生包括指令裝置的制造品,該指令裝置實(shí)現(xiàn)在流程圖一個(gè)流程或多個(gè)流程和/或方框圖一個(gè)方框或多個(gè)方框中指定的功能。這些計(jì)算機(jī)程序指令也可裝載到計(jì)算機(jī)或其他可編程數(shù)據(jù)處理設(shè)備上,使得在計(jì)算機(jī)或其他可編程設(shè)備上執(zhí)行一系列操作步驟以產(chǎn)生計(jì)算機(jī)實(shí)現(xiàn)的處理,從而在計(jì)算機(jī)或其他可編程設(shè)備上執(zhí)行的指令提供用于實(shí)現(xiàn)在流程圖一個(gè)流程或多個(gè)流程和/或方框圖一個(gè)方框或多個(gè)方框中指定的功能的步驟。盡管已描述了本發(fā)明的優(yōu)選實(shí)施例,但本領(lǐng)域內(nèi)的技術(shù)人員一旦得知了基本創(chuàng)造性概念,則可對(duì)這些實(shí)施例作出另外的變更和修改。所以,所附權(quán)利要求意欲解釋為包括優(yōu)選實(shí)施例以及落入本發(fā)明范圍的所有變更和修改。顯然,本領(lǐng)域的技術(shù)人員可以對(duì)本發(fā)明進(jìn)行各種改動(dòng)和變型而不脫離本發(fā)明的精神和范圍。這樣,倘若本發(fā)明的這些修改和變型屬于本發(fā)明權(quán)利要求及其等同技術(shù)的范圍之內(nèi),則本發(fā)明也意圖包含這些改動(dòng)和變型在內(nèi)。當(dāng)前第1頁(yè)12