// Metascan returns template data to PRTG for given tags
Metascan returns template data to PRTG for given tags
// Metascan returns template data to PRTG for given tags
func (c *Client) Metascan(tags []string, tm *TagMap, Age time.Duration) (err error) {
	for _, tag := range tags {
		err := c.getObjIds(tag, tm)
		if err != nil {
			return err
		}
	}
	moidNames := newMoidNames(c)
	meta, err := c.obMeta(tm, moidNames, Age)
	if err != nil {
		return fmt.Errorf("objMeta %v", err)
	}
	if len(meta.Items) == 0 {
		return fmt.Errorf("no data found for tags %v", tags)
	}
	output, err := xml.MarshalIndent(meta, "", "   ")
	if err != nil {
		return fmt.Errorf("marshal %v", err)
	}
	fmt.Printf("%+v", string(output))
	return
}
func ( c * Client ) Metascan ( tags [ ] string , tm * TagMap , Age time . Duration ) ( err error ) { for _ , tag := range tags { err := c . getObjIds ( tag , tm ) if err != nil { return err } } moidNames := newMoidNames ( c ) meta , err := c . obMeta ( tm , moidNames , Age ) if err != nil { return fmt . Errorf ( " " , err ) } if len ( meta . Items ) == 0 { return fmt . Errorf ( " " , tags ) } output , err := xml . MarshalIndent ( meta , " " , " " ) if err != nil { return fmt . Errorf ( " " , err ) } fmt . Printf ( " " , string ( output ) ) return }
Metascan returns template data to PRTG for given tags
Metascan returns template data to PRTG for given tags